Skip to content

Commit

Permalink
ci: add cabal-cache logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TerrorJack committed Nov 16, 2024
1 parent f50c11e commit 28f8f54
Showing 1 changed file with 48 additions and 2 deletions.
50 changes: 48 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,23 @@ 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-reflex-examples --dry-run && echo WASM32_WASI_GHC=$(which wasm32-wasi-ghc) >> $GITHUB_OUTPUT'
- name: cabal-cache
uses: actions/cache@v4
with:
key: nix-${{ hashFiles('dist-newstyle/cache/plan.json') }}
restore-keys: nix-
path: |
~/.ghc-wasm/.cabal/store
dist-newstyle
- 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 @@ -56,14 +70,32 @@ jobs:
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/develop/ghcup-cross-0.0.8.yaml
ghcup install ghc --set wasm32-wasi-9.10.1.20241021 -- $CONFIGURE_ARGS
- name: build-frontend
- name: gen-plan-json
run: |
cd frontend
cabal \
--with-compiler=wasm32-wasi-ghc \
--with-hc-pkg=wasm32-wasi-ghc-pkg \
--with-hsc2hs=wasm32-wasi-hsc2hs \
update
cabal \
--with-compiler=wasm32-wasi-ghc \
--with-hc-pkg=wasm32-wasi-ghc-pkg \
--with-hsc2hs=wasm32-wasi-hsc2hs \
build ghc-wasm-reflex-examples --dry-run
- name: cabal-cache
uses: actions/cache@v4
with:
key: ghcup-${{ hashFiles('dist-newstyle/cache/plan.json') }}
restore-keys: ghcup-
path: |
~/.local/state/cabal/store
dist-newstyle
- name: build-frontend
run: |
cd frontend
./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz
non-nix-build:
Expand Down Expand Up @@ -93,6 +125,20 @@ jobs:
env:
FLAVOUR: '9.10'

- name: gen-plan-json
run: |
cd frontend
wasm32-wasi-cabal build ghc-wasm-reflex-examples --dry-run
- name: cabal-cache
uses: actions/cache@v4
with:
key: vanilla-${{ hashFiles('dist-newstyle/cache/plan.json') }}
restore-keys: vanilla-
path: |
~/.ghc-wasm/.cabal/store
dist-newstyle
- name: build-frontend
run: |
cd frontend
Expand Down

0 comments on commit 28f8f54

Please sign in to comment.