From 4b3bb4977ce97a292638145c69bf57d795224de1 Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Thu, 18 Jul 2024 13:05:12 +1000 Subject: [PATCH] ci: add ghc-9.10 to matrix --- .github/workflows/haskell-ci.yml | 87 +++++++++++++------------------- code/cvss/cvss.cabal | 3 +- code/hsec-core/hsec-core.cabal | 2 +- code/hsec-sync/hsec-sync.cabal | 2 +- code/hsec-tools/hsec-tools.cabal | 2 +- code/osv/osv.cabal | 2 +- 6 files changed, 41 insertions(+), 57 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 0581c0d2..72626d5b 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -1,6 +1,6 @@ # This GitHub workflow config has been generated by a script via # -# haskell-ci 'github' '--haddock' '--hlint' '--hlint-job' '9.4.8' '--github-patches' '.github/haskell-ci.patch' 'cabal.project' +# haskell-ci 'github' '--haddock' '--github-patches' '.github/haskell-ci.patch' 'cabal.project' # # To regenerate the script (for example after adjusting tested-with) run # @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.17.20231110 +# version: 0.19.20240708 # -# REGENDATA ("0.17.20231110",["github","--haddock","--hlint","--hlint-job","9.4.8","--github-patches",".github/haskell-ci.patch","cabal.project"]) +# REGENDATA ("0.19.20240708",["github","--haddock","--github-patches",".github/haskell-ci.patch","cabal.project"]) # name: Haskell-CI on: @@ -38,19 +38,24 @@ jobs: timeout-minutes: 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: - - compiler: ghc-9.8.1 + - compiler: ghc-9.10.1 compilerKind: ghc - compilerVersion: 9.8.1 + compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false - - compiler: ghc-9.6.3 + - compiler: ghc-9.8.2 compilerKind: ghc - compilerVersion: 9.6.3 + compilerVersion: 9.8.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.6.6 + compilerKind: ghc + compilerVersion: 9.6.6 setup-method: ghcup allow-failure: false - compiler: ghc-9.4.8 @@ -80,10 +85,10 @@ jobs: apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -101,7 +106,7 @@ jobs: echo "HC=$HC" >> "$GITHUB_ENV" echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" @@ -148,11 +153,6 @@ jobs: - name: update cabal index run: | $CABAL v2-update -v - - name: cache (tools) - uses: actions/cache/restore@v3 - with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-d8b62173 - path: ~/.haskell-ci-tools - name: install cabal-plan run: | mkdir -p $HOME/.cabal/bin @@ -162,29 +162,17 @@ jobs: rm -f cabal-plan.xz chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version - - name: install hlint - run: | - if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.5 && <3.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi - if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then if [ ! -e $HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint ]; then echo "Downloading HLint version $HLINTVER"; mkdir -p $HOME/.haskell-ci-tools; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\n' --silent --location --output $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz "https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz"; tar -xzv -f $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz -C $HOME/.haskell-ci-tools; fi ; fi - if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi - if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then hlint --version ; fi - - name: save cache (tools) - uses: actions/cache/save@v3 - if: always() - with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-d8b62173 - path: ~/.haskell-ci-tools - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: source - name: initial cabal.project for sdist run: | touch cabal.project - echo "packages: $GITHUB_WORKSPACE/source/code/hsec-core" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/code/hsec-tools" >> cabal.project - echo "packages: $GITHUB_WORKSPACE/source/code/hsec-sync" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/code/cvss" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/code/hsec-core" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/code/hsec-sync" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/code/osv" >> cabal.project cat cabal.project - name: sdist @@ -199,35 +187,35 @@ jobs: run: | PKGDIR_hsec_tools="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/hsec-tools-[0-9.]*')" echo "PKGDIR_hsec_tools=${PKGDIR_hsec_tools}" >> "$GITHUB_ENV" - PKGDIR_hsec_sync="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/hsec-sync-[0-9.]*')" - echo "PKGDIR_hsec_sync=${PKGDIR_hsec_sync}" >> "$GITHUB_ENV" + PKGDIR_cvss="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/cvss-[0-9.]*')" + echo "PKGDIR_cvss=${PKGDIR_cvss}" >> "$GITHUB_ENV" PKGDIR_hsec_core="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/hsec-core-[0-9.]*')" echo "PKGDIR_hsec_core=${PKGDIR_hsec_core}" >> "$GITHUB_ENV" + PKGDIR_hsec_sync="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/hsec-sync-[0-9.]*')" + echo "PKGDIR_hsec_sync=${PKGDIR_hsec_sync}" >> "$GITHUB_ENV" PKGDIR_osv="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/osv-[0-9.]*')" echo "PKGDIR_osv=${PKGDIR_osv}" >> "$GITHUB_ENV" - PKGDIR_cvss="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/cvss-[0-9.]*')" - echo "PKGDIR_cvss=${PKGDIR_cvss}" >> "$GITHUB_ENV" rm -f cabal.project cabal.project.local touch cabal.project touch cabal.project.local - echo "packages: ${PKGDIR_hsec_core}" >> cabal.project echo "packages: ${PKGDIR_hsec_tools}" >> cabal.project + echo "packages: ${PKGDIR_cvss}" >> cabal.project + echo "packages: ${PKGDIR_hsec_core}" >> cabal.project echo "packages: ${PKGDIR_hsec_sync}" >> cabal.project echo "packages: ${PKGDIR_osv}" >> cabal.project - echo "packages: ${PKGDIR_cvss}" >> cabal.project echo "package hsec-tools" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project - echo "package hsec-sync" >> cabal.project + echo "package cvss" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project echo "package hsec-core" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project - echo "package osv" >> cabal.project + echo "package hsec-sync" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project - echo "package cvss" >> cabal.project + echo "package osv" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(cvss|hsec-core|hsec-sync|hsec-tools|osv)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -235,7 +223,7 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - name: restore cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store @@ -253,21 +241,16 @@ jobs: - name: tests run: | $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - - name: hlint - run: | - if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_hsec_tools} && hlint -XHaskell2010 src) ; fi - if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_hsec_tools} && hlint -XHaskell2010 app) ; fi - if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_hsec_core} && hlint -XHaskell2010 src) ; fi - if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_osv} && hlint -XHaskell2010 src) ; fi - if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_cvss} && hlint -XHaskell2010 src) ; fi - name: cabal check run: | - cd ${PKGDIR_hsec_core} || false - ${CABAL} -vnormal check cd ${PKGDIR_hsec_tools} || false ${CABAL} -vnormal check cd ${PKGDIR_cvss} || false ${CABAL} -vnormal check + cd ${PKGDIR_hsec_core} || false + ${CABAL} -vnormal check + cd ${PKGDIR_hsec_sync} || false + ${CABAL} -vnormal check cd ${PKGDIR_osv} || false ${CABAL} -vnormal check - name: haddock @@ -278,7 +261,7 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 if: always() with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} diff --git a/code/cvss/cvss.cabal b/code/cvss/cvss.cabal index f9d1fbb1..27e18e00 100644 --- a/code/cvss/cvss.cabal +++ b/code/cvss/cvss.cabal @@ -10,7 +10,8 @@ author: Tristan de Cacqueray maintainer: tdecacqu@redhat.com category: Data extra-doc-files: CHANGELOG.md -tested-with: GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1 +tested-with: + GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1 library exposed-modules: Security.CVSS diff --git a/code/hsec-core/hsec-core.cabal b/code/hsec-core/hsec-core.cabal index 3c5dfb12..235ef6f6 100644 --- a/code/hsec-core/hsec-core.cabal +++ b/code/hsec-core/hsec-core.cabal @@ -22,7 +22,7 @@ category: Data extra-doc-files: CHANGELOG.md tested-with: - GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1 + GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1 library exposed-modules: diff --git a/code/hsec-sync/hsec-sync.cabal b/code/hsec-sync/hsec-sync.cabal index d95b42e8..f2f5a492 100644 --- a/code/hsec-sync/hsec-sync.cabal +++ b/code/hsec-sync/hsec-sync.cabal @@ -21,7 +21,7 @@ maintainer: gautier.difolco@gmail.com category: Data extra-doc-files: CHANGELOG.md tested-with: - GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1 + GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1 library exposed-modules: Security.Advisories.Sync diff --git a/code/hsec-tools/hsec-tools.cabal b/code/hsec-tools/hsec-tools.cabal index dbefd9a5..1bd4f5a4 100644 --- a/code/hsec-tools/hsec-tools.cabal +++ b/code/hsec-tools/hsec-tools.cabal @@ -29,7 +29,7 @@ extra-source-files: test/golden/*.md tested-with: - GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1 + GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1 library exposed-modules: diff --git a/code/osv/osv.cabal b/code/osv/osv.cabal index eca44e11..ef5d2546 100644 --- a/code/osv/osv.cabal +++ b/code/osv/osv.cabal @@ -24,7 +24,7 @@ category: Data extra-doc-files: CHANGELOG.md tested-with: - GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1 + GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1 library exposed-modules: