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

Commit 794d769

Browse files
committed
ci: add cabal-cache logic
1 parent ef797c2 commit 794d769

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,23 @@ 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: nix-
33+
path: |
34+
~/.ghc-wasm/.cabal/store
35+
dist-newstyle
36+
2337
- name: build-frontend
2438
run: |
25-
nix develop --command bash -c "cd frontend && wasm32-wasi-cabal update && exec ./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz"
39+
nix develop --command bash -c "cd frontend && exec ./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz"
2640
2741
ghcup-build:
2842
name: ghcup-build
@@ -52,14 +66,32 @@ jobs:
5266
5367
- uses: dw-labs-org/dart-sass-gha@v1
5468

55-
- name: build-frontend
69+
- name: gen-plan-json
5670
run: |
5771
cd frontend
5872
cabal \
5973
--with-compiler=wasm32-wasi-ghc \
6074
--with-hc-pkg=wasm32-wasi-ghc-pkg \
6175
--with-hsc2hs=wasm32-wasi-hsc2hs \
6276
update
77+
cabal \
78+
--with-compiler=wasm32-wasi-ghc \
79+
--with-hc-pkg=wasm32-wasi-ghc-pkg \
80+
--with-hsc2hs=wasm32-wasi-hsc2hs \
81+
build ghc-wasm-miso-examples --dry-run
82+
83+
- name: cabal-cache
84+
uses: actions/cache@v4
85+
with:
86+
key: ghcup-${{ hashFiles('dist-newstyle/cache/plan.json') }}
87+
restore-keys: ghcup-
88+
path: |
89+
~/.local/state/cabal/store
90+
dist-newstyle
91+
92+
- name: build-frontend
93+
run: |
94+
cd frontend
6395
./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz
6496
6597
non-nix-build:
@@ -85,6 +117,20 @@ jobs:
85117

86118
- uses: dw-labs-org/dart-sass-gha@v1
87119

120+
- name: gen-plan-json
121+
run: |
122+
cd frontend
123+
wasm32-wasi-cabal build ghc-wasm-miso-examples --dry-run
124+
125+
- name: cabal-cache
126+
uses: actions/cache@v4
127+
with:
128+
key: vanilla-${{ hashFiles('dist-newstyle/cache/plan.json') }}
129+
restore-keys: vanilla-
130+
path: |
131+
~/.ghc-wasm/.cabal/store
132+
dist-newstyle
133+
88134
- name: build-frontend
89135
run: |
90136
cd frontend

0 commit comments

Comments
 (0)