forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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).
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Check GHC prereleases | ||
|
||
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. | ||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
|
||
# Make sure we support the latest prerelease GHC. This means validating that Cabal doesn't | ||
# output a warning that the GHC is too new. | ||
# | ||
# It's generally pointless to run this when not around a release, but there's no good way | ||
# to automate checking for that so we just run pointlessly. (If it doesn't succeed, we have | ||
# bigger problems.) | ||
|
||
ghc-prerelease: | ||
name: Check compatibility with latest GHC prerelease | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
# first, build cabal-install | ||
- uses: haskell-actions/setup@v2 | ||
with: | ||
# NOTE: for CI rewrite, use GHC_FOR_RELEASE | ||
ghc-version: "9.4.8" | ||
cabal-version: latest | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
# use the release project to silence the prerelease warning, to make | ||
# checking for the too-new-GHC warning easier | ||
- run: cabal build cabal --project-file=cabal.release.project | ||
|
||
# next, install the latest prerelease | ||
- uses: haskell-actions/setup@v2 | ||
name: prerelease-ghc | ||
with: | ||
ghc-version: latest-prerelease | ||
ghcup-release-channel: "https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml" | ||
|
||
# dry run build of Cabal | ||
# if there is a problem, the first two lines of the output will be a warning | ||
- run: $(cabal list-bin cabal) build Cabal --dry-run -w ${{ steps.prerelease-ghc.outputs.ghc-exe }} 2>&1 | tee build.log | ||
shell: bash | ||
|
||
- run: | | ||
if grep -q unknown/unsupported build.log; then | ||
echo Cabal does not support latest GHC prerelease | ||
exit 1 | ||
fi | ||
exit 0 | ||
shell: bash |