13
13
- main
14
14
jobs :
15
15
16
+ typecheck :
17
+ name : Typecheck specification
18
+ runs-on : ubuntu-22.04
19
+ steps :
20
+ - name : 📥 Checkout repository
21
+ uses : actions/checkout@v4
22
+ - name : 💾 Cache Nix store
23
+
24
+ id : nix-cache
25
+ with :
26
+ path : /tmp/nixcache
27
+ key : ${{ runner.os }}-nix-typecheck-${{ hashFiles('flake.lock') }}
28
+ restore-keys : ${{ runner.os }}-nix-typecheck-
29
+ - name : 🛠️ Install Nix
30
+ uses : cachix/install-nix-action@v21
31
+ with :
32
+ nix_path : nixpkgs=channel:nixos-unstable
33
+ install_url : https://releases.nixos.org/nix/nix-2.10.3/install
34
+ extra_nix_config : |
35
+ allowed-uris = ${{ env.ALLOWED_URIS }}
36
+ trusted-public-keys = ${{ env.TRUSTED_PUBLIC_KEYS }}
37
+ substituters = ${{ env.SUBSTITUTERS }}
38
+ experimental-features = nix-command flakes
39
+ - name : 💾➤ Import Nix store cache
40
+ if : " steps.nix-cache.outputs.cache-hit == 'true'"
41
+ run : " nix-store --import < /tmp/nixcache"
42
+ - name : 🏗️ Build specification
43
+ run : |
44
+ nix build --show-trace --accept-flake-config .#leiosSpec
45
+ - name : ➤💾 Export Nix store cache
46
+ if : " steps.nix-cache.outputs.cache-hit != 'true'"
47
+ run : " nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nixcache"
48
+
16
49
compile :
17
50
name : Build libraries
18
51
runs-on : ubuntu-22.04
19
52
steps :
20
53
- name : 📥 Checkout repository
21
54
uses : actions/checkout@v4
55
+ - name : 💾 Cache Nix store
56
+
57
+ id : nix-cache
58
+ with :
59
+ path : /tmp/nixcache
60
+ key : ${{ runner.os }}-nix-compile-${{ hashFiles('flake.lock') }}
61
+ restore-keys : ${{ runner.os }}-nix-compile-
22
62
- name : 🛠️ Install Nix
23
63
uses : cachix/install-nix-action@v21
24
64
with :
@@ -29,12 +69,18 @@ jobs:
29
69
trusted-public-keys = ${{ env.TRUSTED_PUBLIC_KEYS }}
30
70
substituters = ${{ env.SUBSTITUTERS }}
31
71
experimental-features = nix-command flakes
72
+ - name : 💾➤ Import Nix store cache
73
+ if : " steps.nix-cache.outputs.cache-hit == 'true'"
74
+ run : " nix-store --import < /tmp/nixcache"
32
75
- name : 🏗️ Build `exe:leios`
33
76
run : |
34
77
nix build --show-trace --accept-flake-config .#leios
35
78
- name : 🏗️ Build `exe:ouroboros-net-vis`
36
79
run : |
37
80
nix build --show-trace --accept-flake-config .#ouroboros-net-vis
81
+ - name : ➤💾 Export Nix store cache
82
+ if : " steps.nix-cache.outputs.cache-hit != 'true'"
83
+ run : " nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nixcache"
38
84
39
85
tests :
40
86
if : true
43
89
steps :
44
90
- name : 📥 Checkout repository
45
91
uses : actions/checkout@v4
92
+ - name : 💾 Cache Nix store
93
+
94
+ id : nix-cache
95
+ with :
96
+ path : /tmp/nixcache
97
+ key : ${{ runner.os }}-nix-tests-${{ hashFiles('flake.lock') }}
98
+ restore-keys : ${{ runner.os }}-nix-tests-
46
99
- name : 🛠️ Install Nix
47
100
uses : cachix/install-nix-action@v21
48
101
with :
@@ -53,9 +106,15 @@ jobs:
53
106
trusted-public-keys = ${{ env.TRUSTED_PUBLIC_KEYS }}
54
107
substituters = ${{ env.SUBSTITUTERS }}
55
108
experimental-features = nix-command flakes
109
+ - name : 💾➤ Import Nix store cache
110
+ if : " steps.nix-cache.outputs.cache-hit == 'true'"
111
+ run : " nix-store --import < /tmp/nixcache"
56
112
- name : 🔬 Test with `leios-sim-test`
57
113
run : |
58
114
nix run --accept-flake-config .#leios-sim-test
115
+ - name : ➤💾 Export Nix store cache
116
+ if : " steps.nix-cache.outputs.cache-hit != 'true'"
117
+ run : " nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nixcache"
59
118
60
119
build-docusaurus :
61
120
runs-on : ubuntu-22.04
0 commit comments