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

Commit 7cbfc13

Browse files
committed
ci: add cabal-cache-native logic
1 parent 2fbc4b8 commit 7cbfc13

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,21 @@ 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-native
29+
uses: andreabedini/cabal-cache-native
30+
with:
31+
store-path: /home/runner/.ghc-wasm/.cabal/store
32+
cache-key-prefix: nix
33+
ghc: ${{ steps.gen-plan-json.outputs.WASM32_WASI_GHC }}
34+
2335
- name: build-frontend
2436
run: |
25-
nix develop --command bash -c "cd frontend && wasm32-wasi-cabal update && exec ./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz"
37+
nix develop --command bash -c "cd frontend && exec ./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz"
2638
2739
ghcup-build:
2840
name: ghcup-build
@@ -52,6 +64,21 @@ jobs:
5264
5365
- uses: dw-labs-org/dart-sass-gha@v1
5466

67+
- name: gen-plan-json
68+
run: |
69+
cabal \
70+
--with-compiler=wasm32-wasi-ghc \
71+
--with-hc-pkg=wasm32-wasi-ghc-pkg \
72+
--with-hsc2hs=wasm32-wasi-hsc2hs \
73+
build ghc-wasm-miso-examples --dry-run
74+
75+
- name: cabal-cache-native
76+
uses: andreabedini/cabal-cache-native
77+
with:
78+
store-path: /home/runner/.local/state/cabal/store
79+
cache-key-prefix: ghcup
80+
ghc: wasm32-wasi-ghc
81+
5582
- name: build-frontend
5683
run: |
5784
cd frontend
@@ -85,6 +112,17 @@ jobs:
85112

86113
- uses: dw-labs-org/dart-sass-gha@v1
87114

115+
- name: gen-plan-json
116+
run: |
117+
wasm32-wasi-cabal build ghc-wasm-miso-examples --dry-run
118+
119+
- name: cabal-cache-native
120+
uses: andreabedini/cabal-cache-native
121+
with:
122+
store-path: /home/runner/.ghc-wasm/.cabal/store
123+
cache-key-prefix: vanilla
124+
ghc: wasm32-wasi-ghc
125+
88126
- name: build-frontend
89127
run: |
90128
cd frontend

0 commit comments

Comments
 (0)