Skip to content

Commit 48a4cdf

Browse files
committed
check compatibility with GHC prereleases
This unnecessarily runs even when a prerelease isn't active, but if it fails then then we have bigger problems (like we do right now with a buggy 3.14.1.0 released).
1 parent 56594bd commit 48a4cdf

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Check GHC prereleases
2+
3+
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
4+
concurrency:
5+
group: ${{ github.ref }}-${{ github.workflow }}
6+
cancel-in-progress: true
7+
8+
on:
9+
push:
10+
branches:
11+
- master
12+
pull_request:
13+
release:
14+
types:
15+
- created
16+
17+
jobs:
18+
19+
# Make sure we support the latest prerelease GHC. This means validating that Cabal doesn't
20+
# output a warning that the GHC is too new.
21+
#
22+
# It's generally pointless to run this when not around a release, but there's no good way
23+
# to automate checking for that so we just run pointlessly. (If it doesn't succeed, we have
24+
# bigger problems.)
25+
26+
ghc-prerelease:
27+
name: Check compatibility with latest GHC prerelease
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
32+
# first, build cabal-install
33+
- uses: haskell-actions/setup@v2
34+
id: release-ghc
35+
with:
36+
# NOTE: for CI rewrite, use GHC_FOR_RELEASE
37+
ghc-version: "9.4.8"
38+
cabal-version: latest
39+
40+
- uses: actions/checkout@v4
41+
42+
# use the release project to silence the prerelease warning, to make
43+
# checking for the too-new-GHC warning easier
44+
- run: cabal build cabal --project-file=cabal.release.project
45+
46+
# next, install the latest prerelease
47+
- uses: haskell-actions/setup@v2
48+
name: prerelease-ghc
49+
with:
50+
ghc-version: latest-prerelease
51+
ghcup-release-channel: "https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml"
52+
53+
# dry run build of Cabal
54+
# if there is a problem, the first two lines of the output will be a warning
55+
- run: $(cabal list-bin cabal -w ${{ steps.release-ghc.outputs.ghc-exe }}) build Cabal --dry-run -w ${{ steps.prerelease-ghc.outputs.ghc-exe }} 2>&1 | tee build.log
56+
shell: bash
57+
58+
- run: |
59+
if grep -q unknown/unsupported build.log; then
60+
echo Cabal does not support latest GHC prerelease
61+
exit 1
62+
fi
63+
exit 0
64+
shell: bash

0 commit comments

Comments
 (0)