Skip to content

Commit

Permalink
ci: add cabal-cache-native logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TerrorJack committed Nov 16, 2024
1 parent 2fbc4b8 commit 6a8fc1c
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,21 @@ jobs:
- name: install-nix
uses: DeterminateSystems/nix-installer-action@v16

- name: gen-plan-json
id: gen-plan-json
run: |
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'
- name: cabal-cache-native
uses: andreabedini/cabal-cache-native@main
with:
store-path: /home/runner/.ghc-wasm/.cabal/store
cache-key-prefix: nix
ghc: ${{ steps.gen-plan-json.outputs.WASM32_WASI_GHC }}

- name: build-frontend
run: |
nix develop --command bash -c "cd frontend && wasm32-wasi-cabal update && exec ./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz"
nix develop --command bash -c "cd frontend && exec ./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz"
ghcup-build:
name: ghcup-build
Expand Down Expand Up @@ -52,6 +64,21 @@ jobs:
- uses: dw-labs-org/dart-sass-gha@v1

- name: gen-plan-json
run: |
cabal \
--with-compiler=wasm32-wasi-ghc \
--with-hc-pkg=wasm32-wasi-ghc-pkg \
--with-hsc2hs=wasm32-wasi-hsc2hs \
build ghc-wasm-miso-examples --dry-run
- name: cabal-cache-native
uses: andreabedini/cabal-cache-native@main
with:
store-path: /home/runner/.local/state/cabal/store
cache-key-prefix: ghcup
ghc: wasm32-wasi-ghc

- name: build-frontend
run: |
cd frontend
Expand Down Expand Up @@ -85,6 +112,17 @@ jobs:

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

- name: gen-plan-json
run: |
wasm32-wasi-cabal build ghc-wasm-miso-examples --dry-run
- name: cabal-cache-native
uses: andreabedini/cabal-cache-native@main
with:
store-path: /home/runner/.ghc-wasm/.cabal/store
cache-key-prefix: vanilla
ghc: wasm32-wasi-ghc

- name: build-frontend
run: |
cd frontend
Expand Down

0 comments on commit 6a8fc1c

Please sign in to comment.