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

Commit eb7e8ff

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

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 2 deletions
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@main
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,14 +64,30 @@ jobs:
5264
5365
- uses: dw-labs-org/dart-sass-gha@v1
5466

55-
- name: build-frontend
67+
- name: gen-plan-json
5668
run: |
5769
cd frontend
5870
cabal \
5971
--with-compiler=wasm32-wasi-ghc \
6072
--with-hc-pkg=wasm32-wasi-ghc-pkg \
6173
--with-hsc2hs=wasm32-wasi-hsc2hs \
6274
update
75+
cabal \
76+
--with-compiler=wasm32-wasi-ghc \
77+
--with-hc-pkg=wasm32-wasi-ghc-pkg \
78+
--with-hsc2hs=wasm32-wasi-hsc2hs \
79+
build ghc-wasm-miso-examples --dry-run
80+
81+
- name: cabal-cache-native
82+
uses: andreabedini/cabal-cache-native@main
83+
with:
84+
store-path: /home/runner/.local/state/cabal/store
85+
cache-key-prefix: ghcup
86+
ghc: wasm32-wasi-ghc
87+
88+
- name: build-frontend
89+
run: |
90+
cd frontend
6391
./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz
6492
6593
non-nix-build:
@@ -85,6 +113,18 @@ jobs:
85113

86114
- uses: dw-labs-org/dart-sass-gha@v1
87115

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

0 commit comments

Comments
 (0)