From 474db77c95747b9c1291796f4b7c6db2cd9f1aac Mon Sep 17 00:00:00 2001 From: Adithya Kumar Date: Sat, 26 Oct 2024 20:29:04 +0530 Subject: [PATCH] Update packcheck and add ghc-9.12.1-alpha to the CI --- .github/workflows/haskell.yml | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index c513c52..9e04fe9 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -29,13 +29,14 @@ jobs: # ------------------------------------------------------------------------ PACKCHECK_LOCAL_PATH: "./packcheck.sh" PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck" - PACKCHECK_GITHUB_COMMIT: "v0.6.0" + PACKCHECK_GITHUB_COMMIT: "e575ff318c93add2a6d3f9107a52c5e37c666a98" # ------------------------------------------------------------------------ # Build options # ------------------------------------------------------------------------ BUILD: cabal-v2 ${{ matrix.pack_options }} GHCVER: ${{ matrix.ghc_version }} + CABALVER: ${{ matrix.cabal_version }} runs-on: ${{ matrix.runner }} # [NOTE] The following is a hack to fix the lack of “allow-failure” feature. @@ -58,7 +59,7 @@ jobs: - 9.6.5 - 9.8.2 - 9.10.1+ucd2haskell - - latest-nightly + - 9.12.1-alpha - hlint include: @@ -135,17 +136,27 @@ jobs: - name: 9.8.2 ghc_version: 9.8.2 + cabal_version: 3.12.1.0 runner: ubuntu-latest cabal_version: latest ignore_error: false - name: 9.10.1+ucd2haskell ghc_version: 9.10.1 + cabal_version: 3.12.1.0 pack_options: CABAL_BUILD_OPTIONS="-f ucd2haskell" runner: ubuntu-latest cabal_version: latest ignore_error: false + - name: 9.12.1-alpha + ghc_version: head + cabal_version: 3.12.1.0 + pack_options: GHCUP_GHC_OPTIONS="-u https://downloads.haskell.org/ghc/9.12.1-alpha1/ghc-9.12.20241014-x86_64-deb12-linux.tar.xz" + runner: ubuntu-latest + cabal_version: latest + ignore_error: false + # Template for release candidates # - name: 9.10.0 # ghc_version: 9.8.0.XXXXX @@ -154,15 +165,6 @@ jobs: # cabal_version: latest # ignore_error: false - # [TODO] Use latest cabal (pre-)release - - name: latest-nightly - ghc_version: latest-nightly - ghcup_release_channel: "https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml" - runner: ubuntu-latest - # cabal_version: 3.11.0.0 - cabal_version: latest - ignore_error: true - - name: hlint pack_options: HLINT_OPTIONS="lint" HLINT_TARGETS="lib exe" runner: ubuntu-latest @@ -172,12 +174,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: haskell-actions/setup@v2 - with: - ghc-version: ${{ matrix.ghc_version }} - ghcup-release-channel: ${{ matrix.ghcup_release_channel }} - cabal-version: ${{ matrix.cabal_version }} - - uses: actions/cache@v4 name: Cache ~/.cabal with: @@ -186,18 +182,22 @@ jobs: - name: Download packcheck run: | - # If a custom stack-yaml is specified, replace the default with that - if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi - unset STACK_YAML - - # Get packcheck if needed - CURL=$(which curl) - PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh - if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi; - chmod +x $PACKCHECK_LOCAL_PATH + if test ! -e "$PACKCHECK" + then + if test -z "$PACKCHECK_GITHUB_COMMIT" + then + die "PACKCHECK_GITHUB_COMMIT is not specified." + fi + PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh + curl --fail -sL -o "$PACKCHECK" $PACKCHECK_URL || exit 1 + chmod +x $PACKCHECK + elif test ! -x "$PACKCHECK" + then + chmod +x $PACKCHECK + fi - name: Run packcheck run: | - # Unset GHC version if it is not numeric, e.g. “latest-nightly” - ! [[ $GHCVER =~ ^([[:digit:]]+) ]] && unset GHCVER + # /usr/local/opt/curl/bin for macOS + export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin bash -c "$PACKCHECK_LOCAL_PATH $BUILD"