@@ -2,9 +2,9 @@ name: "CI"
22
33on :
44 push :
5- branches : [ "master" ]
5+ branches : ["master", "restaumatic" ]
66 pull_request :
7- branches : [ "master" ]
7+ branches : ["master", "restaumatic" ]
88 paths :
99 - .github/workflows/**/*.yml
1010 - app/**/*
2020 - purescript.cabal
2121 - Setup.hs
2222 - stack.yaml
23+ - stack.yaml.lock
2324 - update-changelog.hs
2425 - weeder.dhall
2526 release :
26- types : [ "published" ]
27+ types : ["published"]
2728
2829defaults :
2930 run :
@@ -32,7 +33,7 @@ defaults:
3233env :
3334 CI_PRERELEASE : " ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}"
3435 CI_RELEASE : " ${{ github.event_name == 'release' }}"
35- STACK_VERSION : " 2.15 .1"
36+ STACK_VERSION : " 3.3 .1"
3637
3738concurrency :
3839 # We never want two prereleases building at the same time, since they would
@@ -53,16 +54,18 @@ jobs:
5354 fail-fast : false # do not cancel builds for other OSes if one fails
5455 matrix :
5556 include :
56- - # If upgrading the Haskell image, also upgrade it in the lint job below
57- os : ["ubuntu-latest"]
58- image : haskell:9.2.8@sha256:b3b2f3909c7381bb96b8f18766f9407a3d6f61e0f07ea95e812583ac4f442cbb
59- - os : ["macOS-14"]
60- - os : ["windows-2019"]
61- - os : ["self-hosted", "macos", "ARM64"]
62- - os : ["self-hosted", "Linux", "ARM64"]
57+ - image : haskell:9.6.6 # Also upgrade version in the lint job below
58+ os : ubuntu-latest # Exact version is not important, as it's only the container host)
59+
60+ - image : haskell:9.6.6
61+ os : ubuntu-24.04-arm # Exact version is not important, as it's only the container host
62+
63+ - os : macos-13 # x64
64+ - os : macos-14 # arm64
65+ - os : windows-2019 # x64
6366
6467 runs-on : " ${{ matrix.os }}"
65- container : " ${{ matrix.image }}"
68+ container : " ${{ matrix.image }}"
6669
6770 outputs :
6871 do-not-prerelease : " ${{ steps.build.outputs.do-not-prerelease }}"
@@ -71,43 +74,40 @@ jobs:
7174 steps :
7275 - # We need `gh` installed on the Linux version. Otherwise, release artifacts won't be uploaded.
7376 name : " (Linux only) Install gh"
74- if : " contains (matrix.os , 'ubuntu-latest') "
77+ if : startsWith (matrix.image , 'haskell')
7578 run : |
7679 curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
7780 chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
7881 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
7982 apt-get update
80- apt-get install gh
83+ apt-get install -y gh
8184
82- - uses : " actions/checkout@v2 "
83- - uses : " actions/setup-node@v2 "
85+ - uses : " actions/checkout@v4 "
86+ - uses : " actions/setup-node@v4 "
8487 with :
85- node-version : " 16 "
88+ node-version : " 22 "
8689
8790 - id : " haskell"
8891 name : " (Non-Linux only) Install Haskell"
89- # Note: here we exclude the self-hosted runners because this action does not work on ARM
90- # and their Haskell environment is instead provided by a nix-shell
91- # See https://github.com/purescript/purescript/pulls/4455
92- if : " !contains(matrix.os, 'ubuntu-latest') && !contains(matrix.os, 'self-hosted')"
92+ if : startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows')
9393 uses : " haskell-actions/setup@v2"
9494 with :
95+ ghc-version : " 9.6.6"
9596 enable-stack : true
9697 stack-version : " ${{ env.STACK_VERSION }}"
9798 stack-no-global : true
9899
99- - name : " (Linux only) Check Stack version and fix working directory ownership"
100- if : " contains (matrix.os , 'ubuntu-latest') "
100+ - name : " (Linux only) Fix working directory ownership"
101+ if : startsWith (matrix.image , 'haskell')
101102 run : |
102- [ "$(stack --numeric-version)" = "$STACK_VERSION" ]
103103 chown root:root .
104104
105- - uses : " actions/cache@v2 "
105+ - uses : " actions/cache@v4 "
106106 with :
107107 path : |
108108 /root/.stack
109109 ${{ steps.haskell.outputs.stack-root }}
110- key : " ${{ matrix.image || runner.os }}--MdyPsf-${{ hashFiles('stack.yaml') }}"
110+ key : " ${{ matrix.image || runner.os }}--MdyPsf-${{ hashFiles('stack.yaml.lock', 'purescript.cabal ') }}"
111111
112112 - name : " (Windows only) Configure Stack to store its programs in STACK_ROOT"
113113 # This ensures that the local GHC and MSYS binaries that Stack installs
@@ -122,16 +122,16 @@ jobs:
122122 run : " ci/fix-home ci/build.sh"
123123
124124 - name : " (Linux only) Glob tests"
125- if : " contains (matrix.os , 'ubuntu-latest') "
125+ if : startsWith (matrix.image , 'haskell')
126126 working-directory : " sdist-test"
127127 # We build in this directory in build.sh, so this is where we need to
128128 # launch `stack exec`. The actual glob checks happen in a temporary directory.
129129 run : |
130- apt-get install tree
130+ apt-get install -y tree
131131 ../ci/fix-home stack exec bash ../glob-test.sh
132132
133133 - name : " (Linux only) Build the entire package set"
134- if : " contains (matrix.os , 'ubuntu-latest') "
134+ if : startsWith (matrix.image , 'haskell')
135135 # We build in this directory in build.sh, so this is where we need to
136136 # launch `stack exec`. The actual package-set building happens in a
137137 # temporary directory.
@@ -144,11 +144,11 @@ jobs:
144144 # Moreover, npm has a hook issue that will cause spago to fail to install
145145 # We upgrade npm to fix this
146146 run : |
147- npm i -g npm@8.8.0
147+ apt-get install -y jq
148148 ../ci/fix-home stack --haddock exec ../ci/build-package-set.sh
149149
150150 - name : Verify that 'libtinfo' isn't in binary
151- if : " runner.os == 'Linux'"
151+ if : runner.os == 'Linux'
152152 working-directory : " sdist-test"
153153 run : |
154154 if [ $(ldd $(../ci/fix-home stack path --local-doc-root)/../bin/purs | grep 'libtinfo' | wc -l) -ge 1 ]; then
@@ -157,17 +157,6 @@ jobs:
157157 exit 1
158158 fi
159159
160- - name : " (Self-hosted Linux ARM64 only) Patch the binary to work on non-Nix systems"
161- if : " runner.os == 'Linux' && runner.arch == 'ARM64'"
162- working-directory : " sdist-test"
163- # The self-hosted build happens inside a nix-shell that provides a working stack binary
164- # on ARM systems, and while the macOS binary is fine - because macOS binaries are almost
165- # statically linked), the linux ones are all pointing at the nix store.
166- # So here we first point the binary to the right linker that should work on a generic linux,
167- # and then fix the RUNPATH with the right location to load the shared libraries from
168- run : |
169- patchelf --set-interpreter /usr/lib/ld-linux-aarch64.so.1 --set-rpath /usr/lib/aarch64-linux-gnu $(stack path --local-doc-root)/../bin/purs
170-
171160 - name : " (Release/prerelease only) Create bundle"
172161 if : " ${{ env.CI_RELEASE == 'true' || env.CI_PRERELEASE == 'true' && steps.build.outputs.do-not-prerelease != 'true' }}"
173162 run : |
@@ -199,7 +188,7 @@ jobs:
199188
200189 - name : " (Prerelease only) Upload bundle"
201190 if : " ${{ env.CI_PRERELEASE == 'true' && steps.build.outputs.do-not-prerelease != 'true' }}"
202- uses : " actions/upload-artifact@v3 "
191+ uses : " actions/upload-artifact@v4.6.0 "
203192 with :
204193 name : " ${{ runner.os }}-${{ runner.arch }}-bundle"
205194 path : |
@@ -208,86 +197,68 @@ jobs:
208197
209198 - name : " (Release only) Publish bundle"
210199 if : " ${{ env.CI_RELEASE == 'true' }}"
211- # This requires the gh command line tool to be installed on our
212- # self-hosted runners
213200 env :
214201 GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
215202 run : " gh release upload --clobber ${{ github.ref_name }} sdist-test/bundle/*.{tar.gz,sha}"
216203
217204 lint :
218- runs-on : " ubuntu-latest"
219- # At the moment, this is a different image from the image used for
220- # compilation, though the GHC versions match. This is because the
221- # compilation image uses an old version of glibc, which we want because it
222- # means our published binaries will work on the widest number of platforms.
223- # But the HLint binary downloaded by this job requires a newer glibc
224- # version.
225- container : haskell:9.2.8@sha256:b3b2f3909c7381bb96b8f18766f9407a3d6f61e0f07ea95e812583ac4f442cbb
205+ container : haskell:9.6.6
206+ runs-on : ubuntu-latest # Exact version is not important, as it's only the container host
226207
227208 steps :
228- - uses : " actions/checkout@v2 "
209+ - uses : " actions/checkout@v4 "
229210
230211 - name : " Fix working directory ownership"
231212 run : |
232213 chown root:root .
233214
234- - uses : " actions/cache@v2 "
215+ - uses : " actions/cache@v4 "
235216 with :
236217 path : |
237218 /root/.stack
238- key : " lint-${{ hashFiles('stack.yaml') }}"
219+ key : " lint-${{ hashFiles('stack.yaml.lock', 'purescript.cabal ') }}"
239220
240221 - run : " ci/fix-home ci/run-hlint.sh --git"
241222 env :
242223 VERSION : " 3.5"
243224
244- # Note: the weeder version will need to be updated when we next update our version
245- # of GHC.
246- #
247- # weeder-2.2.0 has somewhat strange version deps. It doesn't appear to
248- # support the exact versions of dhall and generic-lens in LTS-18.
249- # However, forcing it to use the versions of dhall and generic-lens in
250- # LTS-18 doesn't cause any problems when building, so the following
251- # commands build weeder while ignoring version constraints.
252225 - name : Install weeder
253226 run : |
254- # The `stack.yaml` file is copied to a separate file so that
255- # adding `allow-newer: true` doesn't affect any subsequant
256- # calls to `stack`.
257- cp stack.yaml stack-weeder.yaml
258- # `allow-newer: true` is needed so that weeder-2.2.0 can be
259- # installed with the dependencies present in LTS-18.
260- echo 'allow-newer: true' >> stack-weeder.yaml
261- ci/fix-home stack --no-terminal --jobs=2 build --copy-compiler-tool --stack-yaml ./stack-weeder.yaml weeder-2.4.0
227+ ci/fix-home stack --no-terminal --jobs=2 \
228+ build --copy-compiler-tool weeder-2.8.0
262229
263- - run : " ci/fix-home stack --no-terminal --jobs=2 build --fast --ghc-options -fwrite-ide-info"
230+ - run : |
231+ ci/fix-home stack --no-terminal --jobs=2 \
232+ build --fast --ghc-options -fwrite-ide-info
264233
265234 - run : " ci/fix-home stack exec weeder"
266235
267236 # Now do it again, with the test suite included. We don't want a
268237 # reference from our test suite to count in the above check; the fact
269238 # that a function is tested is not evidence that it's needed. But we also
270239 # don't want to leave weeds lying around in our test suite either.
271- - run : " ci/fix-home stack --no-terminal --jobs=2 build --fast --test --no-run-tests --ghc-options -fwrite-ide-info"
240+ - run : |
241+ ci/fix-home stack --no-terminal --jobs=2 \
242+ build --fast --test --no-run-tests --ghc-options -fwrite-ide-info
272243
273244 - run : " ci/fix-home stack exec weeder"
274245
275246 make-prerelease :
276- runs-on : " ubuntu-latest"
247+ runs-on : ubuntu-latest
277248 needs :
278249 - " build"
279250 - " lint"
280251 if : " ${{ github.event_name == 'push' && needs.build.outputs.do-not-prerelease != 'true' }}"
281252 steps :
282- - uses : " actions/download-artifact@v3 "
253+ - uses : " actions/download-artifact@v4 "
283254 - uses : " ncipollo/release-action@v1.10.0"
284255 with :
285256 tag : " v${{ needs.build.outputs.version }}"
286257 artifacts : " *-bundle/*"
287258 prerelease : true
288259 body : " This is an automated preview release. Get the latest stable release [here](https://github.com/purescript/purescript/releases/latest)."
289- - uses : " actions/checkout@v3 "
290- - uses : " actions/setup-node@v3 "
260+ - uses : " actions/checkout@v4 "
261+ - uses : " actions/setup-node@v4 "
291262 with :
292263 node-version : " 16.x"
293264 registry-url : " https://registry.npmjs.org"
0 commit comments