From ca654f5e8390e667280ae2198f5c69db9765a73c Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Wed, 18 Oct 2023 18:59:27 +0200 Subject: [PATCH 1/2] Bump Haskell-CI to GHC 9.8.1 and 9.6.3 --- .github/workflows/haskell-ci.yml | 43 +++++++++++--------------------- STMonadTrans.cabal | 4 +-- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 97f9d97..74edd4c 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/andreasabel/haskell-ci # -# version: 0.17.20230911 +# version: 0.17.20231012 # -# REGENDATA ("0.17.20230911",["github","STMonadTrans.cabal"]) +# REGENDATA ("0.17.20231012",["github","STMonadTrans.cabal"]) # name: Haskell-CI on: @@ -32,14 +32,14 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.8.0.20230822 + - compiler: ghc-9.8.1 compilerKind: ghc - compilerVersion: 9.8.0.20230822 + compilerVersion: 9.8.1 setup-method: ghcup - allow-failure: true - - compiler: ghc-9.6.2 + allow-failure: false + - compiler: ghc-9.6.3 compilerKind: ghc - compilerVersion: 9.6.2 + compilerVersion: 9.6.3 setup-method: ghcup allow-failure: false - compiler: ghc-9.4.7 @@ -65,27 +65,27 @@ jobs: - compiler: ghc-8.8.4 compilerKind: ghc compilerVersion: 8.8.4 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.6.5 compilerKind: ghc compilerVersion: 8.6.5 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.4.4 compilerKind: ghc compilerVersion: 8.4.4 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-7.10.3 compilerKind: ghc @@ -97,7 +97,7 @@ jobs: - name: apt run: | apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev if [ "${{ matrix.setup-method }}" = ghcup ]; then mkdir -p "$HOME/.ghcup/bin" curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" @@ -146,7 +146,7 @@ jobs: echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" - if [ $((HCNUMVER >= 90800)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi + echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: @@ -175,18 +175,6 @@ jobs: repository hackage.haskell.org url: http://hackage.haskell.org/ EOF - if $HEADHACKAGE; then - cat >> $CABAL_CONFIG <> $CABAL_CONFIG <= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <> cabal.project - fi $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(STMonadTrans)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local diff --git a/STMonadTrans.cabal b/STMonadTrans.cabal index d72968c..d6ce4e0 100644 --- a/STMonadTrans.cabal +++ b/STMonadTrans.cabal @@ -22,8 +22,8 @@ description: Maybe and combinations of their corresponding monad transformers. Tested-With: - GHC == 9.8.0 - GHC == 9.6.2 + GHC == 9.8.1 + GHC == 9.6.3 GHC == 9.4.7 GHC == 9.2.8 GHC == 9.0.2 From 6412fcbe57faf4f406e7cf0d3fe286d7c4612b4f Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Wed, 18 Oct 2023 19:01:06 +0200 Subject: [PATCH 2/2] Stack CI: bump to GHC 9.8.1 etc and overengineer caching Caching is certainly overengineered for this little library. It is more that I am playing here to find out the correct way of caching stack artefacts. --- .github/workflows/stack.yml | 93 +++++++++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 15 deletions(-) diff --git a/.github/workflows/stack.yml b/.github/workflows/stack.yml index 1abc2b0..818a96b 100644 --- a/.github/workflows/stack.yml +++ b/.github/workflows/stack.yml @@ -15,7 +15,7 @@ defaults: jobs: stack: - name: ${{ matrix.os }} stack ${{ matrix.ghc }} + name: Stack ${{ matrix.ghc }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} timeout-minutes: 60 strategy: @@ -23,11 +23,17 @@ jobs: matrix: include: - os: ubuntu-latest - ghc: 9.4.5 - resolver: nightly-2023-05-17 + ghc: 9.8.1 + resolver: nightly-2023-10-17 - os: ubuntu-latest - ghc: 9.2.7 - resolver: lts-20.21 + ghc: 9.6.3 + resolver: nightly-2023-10-17 + - os: ubuntu-latest + ghc: 9.4.7 + resolver: lts-21.16 + - os: ubuntu-latest + ghc: 9.2.8 + resolver: lts-20.26 - os: ubuntu-latest ghc: 9.0.2 resolver: lts-19.33 @@ -60,6 +66,9 @@ jobs: # ghc: 7.8.4 # resolver: lts-2.22 + env: + stack: 'stack --system-ghc --no-install-ghc' + steps: - uses: actions/checkout@v3 @@ -74,20 +83,74 @@ jobs: - name: Create stack.yaml run: | - echo "resolver: ${{ matrix.resolver }}" > stack.yaml - echo "packages: [.]" >> stack.yaml + cat > stack.yaml < '.build-plan.txt' + + - name: Restore cached dependencies + uses: actions/cache/restore@v3 + id: cache-deps + with: + path: | + ${{ steps.setup.outputs.stack-root }}/stack.sqlite3 + ${{ steps.setup.outputs.stack-root }}/snapshots + key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-resolver-${{ matrix.resolver }}-plan-${{ hashfiles('.build-plan.txt') }} + restore-keys: | + ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-resolver-${{ matrix.resolver }}- + ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}- - name: Build dependencies - run: stack build --system-ghc --dependencies-only + if: steps.cache-deps.outputs.cache-hit != 'true' + run: ${{ env.stack }} test --dependencies-only + + - name: Cache dependencies + if: steps.cache-deps.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: | + ${{ steps.setup.outputs.stack-root }}/stack.sqlite3 + ${{ steps.setup.outputs.stack-root }}/snapshots + key: ${{ steps.cache-deps.outputs.cache-primary-key }} + + ## Build and test STMonadTrans + ######################################################################## - - name: Build - run: stack build --system-ghc + - name: Build w/ tests + run: ${{ env.stack }} test --no-run-tests - name: Run tests - run: stack test --system-ghc + run: ${{ env.stack }} test