-
Notifications
You must be signed in to change notification settings - Fork 4
138 lines (113 loc) · 4.01 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: build
on:
merge_group:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
nix-build:
name: nix-build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- 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
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 && exec ./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz"
ghcup-build:
name: ghcup-build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: ghc-wasm-meta
run: |
pushd "$(mktemp -d)"
curl -f -L --retry 5 https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/master/ghc-wasm-meta-master.tar.gz | tar xz --strip-components=1
SKIP_GHC=1 ./setup.sh
~/.ghc-wasm/add_to_github_path.sh
popd
- name: cabal
run: |
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/develop/ghcup-prereleases-0.0.8.yaml
ghcup install cabal --set 3.15.0.0.2024.10.3
- name: wasm32-wasi-ghc
run: |
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
- 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
with:
store-path: /home/runner/.local/state/cabal/store
cache-key-prefix: ghcup
ghc: wasm32-wasi-ghc
- name: build-frontend
run: |
cd frontend
cabal \
--with-compiler=wasm32-wasi-ghc \
--with-hc-pkg=wasm32-wasi-ghc-pkg \
--with-hsc2hs=wasm32-wasi-hsc2hs \
update
./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz
non-nix-build:
name: non-nix-build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: checkout
uses: actions/checkout@v4
- name: ghc-wasm-meta
run: |
pushd "$(mktemp -d)"
curl -f -L --retry 5 https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/master/ghc-wasm-meta-master.tar.gz | tar xz --strip-components=1
./setup.sh
~/.ghc-wasm/add_to_github_path.sh
popd
env:
FLAVOUR: '9.10'
- 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
with:
store-path: /home/runner/.ghc-wasm/.cabal/store
cache-key-prefix: vanilla
ghc: wasm32-wasi-ghc
- name: build-frontend
run: |
cd frontend
./build.sh --low-memory-unused --converge --gufa --flatten --rereloop -Oz
- name: upload-pages-artifact
uses: actions/upload-pages-artifact@v3
with:
path: frontend/dist
retention-days: 90
- name: deploy-pages
uses: actions/deploy-pages@v4