Skip to content

Commit d9a6b28

Browse files
authored
local cache (#152)
* use a local cache
1 parent 417ae72 commit d9a6b28

File tree

1 file changed

+53
-16
lines changed

1 file changed

+53
-16
lines changed

.github/workflows/nix.yml

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,70 @@ on:
1111
branches: [ master ]
1212

1313
jobs:
14-
nix:
14+
hb:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
19-
with:
20-
fetch-depth: 0
21-
- uses: cachix/install-nix-action@v12
22-
- uses: cachix/cachix-action@v8
18+
- name: Cachix install
19+
uses: cachix/install-nix-action@v12
20+
- name: Cachix setup
21+
uses: cachix/cachix-action@v8
2322
with:
2423
name: math-comp
2524
extraPullNames: coq
2625
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
27-
- run: nix-build
26+
- name: Cache Nix Store
27+
uses: actions/[email protected]
28+
id: cache-nix
29+
with:
30+
path: nix-store.nar
31+
key: nix-${{ runner.os }}-${{ github.sha }}
32+
restore-keys: |
33+
nix-${{ runner.os }}-
34+
- name: Import Nix Store
35+
if: steps.cache-nix.outputs.cache-hit
36+
run: nix-store --import < nix-store.nar
37+
- name: Git checkout
38+
uses: actions/checkout@v2
39+
with:
40+
fetch-depth: 0
41+
- name: Build
42+
run: nix-build
43+
- name: Compute Closure
44+
run: nix path-info --all | tee closure.txt
45+
- name: Export Nix Store
46+
run: xargs --arg-file=closure.txt nix-store --export > nix-store.nar
2847

29-
nixci:
48+
mathcomp:
3049
runs-on: ubuntu-latest
31-
needs: nix
32-
50+
needs: hb
3351
steps:
34-
- uses: actions/checkout@v2
35-
with:
36-
fetch-depth: 0
37-
- uses: cachix/install-nix-action@v12
38-
- uses: cachix/cachix-action@v8
52+
- name: Cachix install
53+
uses: cachix/install-nix-action@v12
54+
- name: Cachix setup
55+
uses: cachix/cachix-action@v8
3956
with:
4057
name: math-comp
4158
extraPullNames: coq
4259
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
43-
- run: nix-build --arg ci true
60+
- name: Cache Nix Store
61+
uses: actions/[email protected]
62+
id: cache-nix
63+
with:
64+
path: nix-store.nar
65+
key: nix-${{ runner.os }}-${{ github.sha }}
66+
restore-keys: |
67+
nix-${{ runner.os }}-
68+
- name: Import Nix Store
69+
if: steps.cache-nix.outputs.cache-hit
70+
run: nix-store --import < nix-store.nar
71+
- name: Git checkout
72+
uses: actions/checkout@v2
73+
with:
74+
fetch-depth: 0
75+
- name: Build
76+
run: nix-build --arg ci true
77+
- name: Compute Closure
78+
run: nix path-info --all | tee closure.txt
79+
- name: Export Nix Store
80+
run: xargs --arg-file=closure.txt nix-store --export > nix-store.nar

0 commit comments

Comments
 (0)