Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit fddf4b0

Browse files
committed
ci: add cabal-cache logic
1 parent b9aaa04 commit fddf4b0

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

.github/workflows/build.yml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,25 @@ jobs:
2020
- name: install-nix
2121
uses: DeterminateSystems/nix-installer-action@v16
2222

23+
- name: gen-plan-json
24+
id: gen-plan-json
25+
run: |
26+
nix develop --command bash -c 'cd frontend && wasm32-wasi-cabal update && wasm32-wasi-cabal build ghc-wasm-miso-examples --dry-run && echo WASM32_WASI_GHC=$(which wasm32-wasi-ghc) >> $GITHUB_OUTPUT'
27+
28+
- name: cabal-cache
29+
uses: actions/cache@v4
30+
with:
31+
key: nix-${{ hashFiles('dist-newstyle/cache/plan.json') }}
32+
restore-keys: |
33+
nix-${{ hashFiles('dist-newstyle/cache/plan.json') }}
34+
nix-
35+
path: |
36+
~/.ghc-wasm/.cabal/store
37+
dist-newstyle
38+
2339
- name: build-frontend
2440
run: |
25-
nix develop --command bash -c "cd frontend && wasm32-wasi-cabal update && exec ./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz"
41+
nix develop --command bash -c "cd frontend && exec ./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz"
2642
2743
ghcup-build:
2844
name: ghcup-build
@@ -52,14 +68,34 @@ jobs:
5268
5369
- uses: dw-labs-org/dart-sass-gha@v1
5470

55-
- name: build-frontend
71+
- name: gen-plan-json
5672
run: |
5773
cd frontend
5874
cabal \
5975
--with-compiler=wasm32-wasi-ghc \
6076
--with-hc-pkg=wasm32-wasi-ghc-pkg \
6177
--with-hsc2hs=wasm32-wasi-hsc2hs \
6278
update
79+
cabal \
80+
--with-compiler=wasm32-wasi-ghc \
81+
--with-hc-pkg=wasm32-wasi-ghc-pkg \
82+
--with-hsc2hs=wasm32-wasi-hsc2hs \
83+
build ghc-wasm-miso-examples --dry-run
84+
85+
- name: cabal-cache
86+
uses: actions/cache@v4
87+
with:
88+
key: ghcup-${{ hashFiles('dist-newstyle/cache/plan.json') }}
89+
restore-keys: |
90+
ghcup-${{ hashFiles('dist-newstyle/cache/plan.json') }}
91+
ghcup-
92+
path: |
93+
~/.local/state/cabal/store
94+
dist-newstyle
95+
96+
- name: build-frontend
97+
run: |
98+
cd frontend
6399
./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz
64100
65101
non-nix-build:
@@ -85,6 +121,22 @@ jobs:
85121

86122
- uses: dw-labs-org/dart-sass-gha@v1
87123

124+
- name: gen-plan-json
125+
run: |
126+
cd frontend
127+
wasm32-wasi-cabal build ghc-wasm-miso-examples --dry-run
128+
129+
- name: cabal-cache
130+
uses: actions/cache@v4
131+
with:
132+
key: vanilla-${{ hashFiles('dist-newstyle/cache/plan.json') }}
133+
restore-keys: |
134+
vanilla-${{ hashFiles('dist-newstyle/cache/plan.json') }}
135+
vanilla-
136+
path: |
137+
~/.ghc-wasm/.cabal/store
138+
dist-newstyle
139+
88140
- name: build-frontend
89141
run: |
90142
cd frontend

0 commit comments

Comments
 (0)