From a32cec0af735c4304e83504bc136d40c22288e88 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 21 Jul 2022 12:58:56 +0200 Subject: [PATCH] Sync tested GHC versions and update haskell-ci workflow * Pick the widest common set of GHC major release series to test for all packages and bump to the latest available one. Sadly we can't test 8.6.5 anymore and haskell-ci doesn't know about 9.2.3 yet. * Include all packages tracked by the cabal.project file * Apply PackageMap.hs doctest workaround for distribution-nixpkgs * hlint will need to be reenabled later, see #565. --- .github/workflows/ci-skip-package-map.patch | 13 + .github/workflows/haskell-ci.yml | 43 ++- cabal2nix/cabal2nix.cabal | 2 +- .../workflows/ci-skip-package-map.patch | 13 - .../.github/workflows/haskell-ci.yml | 244 ------------------ .../distribution-nixpkgs.cabal | 2 +- hackage-db/.github/workflows/haskell-ci.yml | 192 -------------- hackage-db/hackage-db.cabal | 2 +- language-nix/language-nix.cabal | 2 +- shell.nix | 1 + 10 files changed, 57 insertions(+), 457 deletions(-) create mode 100644 .github/workflows/ci-skip-package-map.patch delete mode 100644 distribution-nixpkgs/.github/workflows/ci-skip-package-map.patch delete mode 100644 distribution-nixpkgs/.github/workflows/haskell-ci.yml delete mode 100644 hackage-db/.github/workflows/haskell-ci.yml diff --git a/.github/workflows/ci-skip-package-map.patch b/.github/workflows/ci-skip-package-map.patch new file mode 100644 index 000000000..d4b8b7595 --- /dev/null +++ b/.github/workflows/ci-skip-package-map.patch @@ -0,0 +1,13 @@ +diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml +index 7fca651d..c2b799c0 100644 +--- a/.github/workflows/haskell-ci.yml ++++ b/.github/workflows/haskell-ci.yml +@@ -253,7 +253,7 @@ jobs: + cd ${PKGDIR_language_nix} || false + doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src + cd ${PKGDIR_distribution_nixpkgs} || false +- doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src ++ find src -type f -and -not -name 'PackageMap.hs' | xargs doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 + cd ${PKGDIR_hackage_db} || false + doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src + - name: hlint diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 8ddc439b6..12bab7c30 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 '--branches' 'master' '--doctest' '--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen' 'github' 'cabal2nix/cabal2nix.cabal' +# haskell-ci '--branches' 'master' '--github-patches' '.github/workflows/ci-skip-package-map.patch' '--doctest' '--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen' 'github' 'cabal.project' # # To regenerate the script (for example after adjusting tested-with) run # @@ -10,7 +10,7 @@ # # version: 0.14.3 # -# REGENDATA ("0.14.3",["--branches","master","--doctest","--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","github","cabal2nix/cabal2nix.cabal"]) +# REGENDATA ("0.14.3",["--branches","master","--github-patches",".github/workflows/ci-skip-package-map.patch","--doctest","--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","github","cabal.project"]) # name: Haskell-CI on: @@ -32,6 +32,11 @@ jobs: strategy: matrix: include: + - compiler: ghc-9.2.2 + compilerKind: ghc + compilerVersion: 9.2.2 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.0.2 compilerKind: ghc compilerVersion: 9.0.2 @@ -164,7 +169,10 @@ jobs: - name: initial cabal.project for sdist run: | touch cabal.project - echo "packages: $GITHUB_WORKSPACE/source/cabal2nix" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/./cabal2nix" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/./language-nix" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/./distribution-nixpkgs" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/./hackage-db" >> cabal.project cat cabal.project - name: sdist run: | @@ -178,15 +186,30 @@ jobs: run: | PKGDIR_cabal2nix="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/cabal2nix-[0-9.]*')" echo "PKGDIR_cabal2nix=${PKGDIR_cabal2nix}" >> "$GITHUB_ENV" + PKGDIR_language_nix="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/language-nix-[0-9.]*')" + echo "PKGDIR_language_nix=${PKGDIR_language_nix}" >> "$GITHUB_ENV" + PKGDIR_distribution_nixpkgs="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/distribution-nixpkgs-[0-9.]*')" + echo "PKGDIR_distribution_nixpkgs=${PKGDIR_distribution_nixpkgs}" >> "$GITHUB_ENV" + PKGDIR_hackage_db="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/hackage-db-[0-9.]*')" + echo "PKGDIR_hackage_db=${PKGDIR_hackage_db}" >> "$GITHUB_ENV" rm -f cabal.project cabal.project.local touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_cabal2nix}" >> cabal.project + echo "packages: ${PKGDIR_language_nix}" >> cabal.project + echo "packages: ${PKGDIR_distribution_nixpkgs}" >> cabal.project + echo "packages: ${PKGDIR_hackage_db}" >> cabal.project echo "package cabal2nix" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package language-nix" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package distribution-nixpkgs" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package hackage-db" >> 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: $_ installed\n" unless /^(cabal2nix|distribution-nixpkgs|hackage-db|language-nix)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -216,10 +239,22 @@ jobs: run: | cd ${PKGDIR_cabal2nix} || false doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src + cd ${PKGDIR_language_nix} || false + doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src + cd ${PKGDIR_distribution_nixpkgs} || false + find src -type f -and -not -name 'PackageMap.hs' | xargs doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 + cd ${PKGDIR_hackage_db} || false + doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src - name: cabal check run: | cd ${PKGDIR_cabal2nix} || false ${CABAL} -vnormal check + cd ${PKGDIR_language_nix} || false + ${CABAL} -vnormal check + cd ${PKGDIR_distribution_nixpkgs} || false + ${CABAL} -vnormal check + cd ${PKGDIR_hackage_db} || false + ${CABAL} -vnormal check - name: haddock run: | $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all diff --git a/cabal2nix/cabal2nix.cabal b/cabal2nix/cabal2nix.cabal index bc8cfce8d..059b51b57 100644 --- a/cabal2nix/cabal2nix.cabal +++ b/cabal2nix/cabal2nix.cabal @@ -12,7 +12,7 @@ author: Peter Simons -- list all contributors: git log --pretty='%an' | sort | uniq maintainer: sternenseemann stability: stable -tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 +tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.2 category: Distribution, Nix homepage: https://github.com/nixos/cabal2nix#readme bug-reports: https://github.com/nixos/cabal2nix/issues diff --git a/distribution-nixpkgs/.github/workflows/ci-skip-package-map.patch b/distribution-nixpkgs/.github/workflows/ci-skip-package-map.patch deleted file mode 100644 index 4111887d0..000000000 --- a/distribution-nixpkgs/.github/workflows/ci-skip-package-map.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml -index 3cccd73..e9cfb68 100644 ---- a/.github/workflows/haskell-ci.yml -+++ b/.github/workflows/haskell-ci.yml -@@ -222,7 +222,7 @@ jobs: - - name: doctest - run: | - cd ${PKGDIR_distribution_nixpkgs} || false -- doctest -i ../../dist-newstyle/build/*/*/distribution-nixpkgs-*/build/autogen -XHaskell2010 src -+ doctest -i ../../dist-newstyle/build/*/*/distribution-nixpkgs-*/build/autogen -XHaskell2010 src/Distribution/Nixpkgs/Hashes.hs src/Distribution/Nixpkgs/License.hs src/Distribution/Nixpkgs/Meta.hs src/Language/Nix/PrettyPrinting.hs - - name: hlint - run: | - if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then (cd ${PKGDIR_distribution_nixpkgs} && hlint -XHaskell2010 src) ; fi diff --git a/distribution-nixpkgs/.github/workflows/haskell-ci.yml b/distribution-nixpkgs/.github/workflows/haskell-ci.yml deleted file mode 100644 index 66501bed7..000000000 --- a/distribution-nixpkgs/.github/workflows/haskell-ci.yml +++ /dev/null @@ -1,244 +0,0 @@ -# This GitHub workflow config has been generated by a script via -# -# haskell-ci 'github' '--doctest' '--github-patches' '.github/workflows/ci-skip-package-map.patch' '--doctest-options=-i ../../dist-newstyle/build/*/*/distribution-nixpkgs-*/build/autogen' '--hlint' '--hlint-job' '9.0.2' '--hlint-options' '-XCPP' '--ghcup-jobs-jobs' '>= 8.10' 'distribution-nixpkgs.cabal' -# -# To regenerate the script (for example after adjusting tested-with) run -# -# haskell-ci regenerate -# -# For more information, see https://github.com/haskell-CI/haskell-ci -# -# version: 0.14.3 -# -# REGENDATA ("0.14.3",["github","--doctest","--github-patches",".github/workflows/ci-skip-package-map.patch","--doctest-options=-i ../../dist-newstyle/build/*/*/distribution-nixpkgs-*/build/autogen","--hlint","--hlint-job","9.0.2","--hlint-options","-XCPP","--ghcup-jobs-jobs",">= 8.10","distribution-nixpkgs.cabal"]) -# -name: Haskell-CI -on: - - push - - pull_request -jobs: - linux: - name: Haskell-CI - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-18.04 - timeout-minutes: - 60 - container: - image: buildpack-deps:bionic - continue-on-error: ${{ matrix.allow-failure }} - strategy: - matrix: - include: - - compiler: ghc-9.2.2 - compilerKind: ghc - compilerVersion: 9.2.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-9.0.2 - compilerKind: ghc - compilerVersion: 9.0.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.10.7 - compilerKind: ghc - compilerVersion: 8.10.7 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.8.4 - compilerKind: ghc - compilerVersion: 8.8.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.6.5 - compilerKind: ghc - compilerVersion: 8.6.5 - setup-method: hvr-ppa - allow-failure: false - fail-fast: false - steps: - - name: apt - run: | - apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.17.5/x86_64-linux-ghcup-0.1.17.5 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" - "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 - else - apt-add-repository -y 'ppa:hvr/ghc' - apt-get update - apt-get install -y "$HCNAME" - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.17.5/x86_64-linux-ghcup-0.1.17.5 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 - fi - env: - HCKIND: ${{ matrix.compilerKind }} - HCNAME: ${{ matrix.compiler }} - HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - echo "LANG=C.UTF-8" >> "$GITHUB_ENV" - echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" - echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" - HCDIR=/opt/$HCKIND/$HCVER - if [ "${{ matrix.setup-method }}" = ghcup ]; then - HC=$HOME/.ghcup/bin/$HCKIND-$HCVER - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" - echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - - 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" - echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" - echo "HEADHACKAGE=false" >> "$GITHUB_ENV" - echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" - env: - HCKIND: ${{ matrix.compilerKind }} - HCNAME: ${{ matrix.compiler }} - HCVER: ${{ matrix.compilerVersion }} - - name: env - run: | - env - - name: write cabal config - run: | - mkdir -p $CABAL_DIR - cat >> $CABAL_CONFIG <> $CABAL_CONFIG < cabal-plan.xz - echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - cabal-plan --version - - name: install doctest - run: | - $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20' - doctest --version - - name: install hlint - run: | - if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.3 && <3.4' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi - if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -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 >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi - if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then hlint --version ; fi - - name: checkout - uses: actions/checkout@v2 - with: - path: source - - name: initial cabal.project for sdist - run: | - touch cabal.project - echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project - cat cabal.project - - name: sdist - run: | - mkdir -p sdist - $CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist - - name: unpack - run: | - mkdir -p unpacked - find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; - - name: generate cabal.project - run: | - PKGDIR_distribution_nixpkgs="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/distribution-nixpkgs-[0-9.]*')" - echo "PKGDIR_distribution_nixpkgs=${PKGDIR_distribution_nixpkgs}" >> "$GITHUB_ENV" - rm -f cabal.project cabal.project.local - touch cabal.project - touch cabal.project.local - echo "packages: ${PKGDIR_distribution_nixpkgs}" >> cabal.project - echo "package distribution-nixpkgs" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project - cat >> cabal.project <> cabal.project.local - cat cabal.project - cat cabal.project.local - - name: dump install plan - run: | - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all - cabal-plan - - name: cache - uses: actions/cache@v2 - with: - key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} - path: ~/.cabal/store - restore-keys: ${{ runner.os }}-${{ matrix.compiler }}- - - name: install dependencies - run: | - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all - - name: build w/o tests - run: | - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - - name: build - run: | - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - - name: tests - run: | - $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - - name: doctest - run: | - cd ${PKGDIR_distribution_nixpkgs} || false - doctest -i ../../dist-newstyle/build/*/*/distribution-nixpkgs-*/build/autogen -XHaskell2010 src/Distribution/Nixpkgs/Hashes.hs src/Distribution/Nixpkgs/License.hs src/Distribution/Nixpkgs/Meta.hs src/Language/Nix/PrettyPrinting.hs - - name: hlint - run: | - if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then (cd ${PKGDIR_distribution_nixpkgs} && hlint -XCPP -XHaskell2010 src) ; fi - - name: cabal check - run: | - cd ${PKGDIR_distribution_nixpkgs} || false - ${CABAL} -vnormal check - - name: haddock - run: | - $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - - name: unconstrained build - run: | - rm -f cabal.project.local - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all diff --git a/distribution-nixpkgs/distribution-nixpkgs.cabal b/distribution-nixpkgs/distribution-nixpkgs.cabal index 73d788d7d..ab3c11900 100644 --- a/distribution-nixpkgs/distribution-nixpkgs.cabal +++ b/distribution-nixpkgs/distribution-nixpkgs.cabal @@ -6,7 +6,7 @@ license: BSD3 license-file: LICENSE author: Peter Simons maintainer: sternenseemann -tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.2 +tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.2 category: Distribution, Nix homepage: https://github.com/NixOS/distribution-nixpkgs bug-reports: https://github.com/NixOS/distribution-nixpkgs/issues diff --git a/hackage-db/.github/workflows/haskell-ci.yml b/hackage-db/.github/workflows/haskell-ci.yml deleted file mode 100644 index 450cd421d..000000000 --- a/hackage-db/.github/workflows/haskell-ci.yml +++ /dev/null @@ -1,192 +0,0 @@ -# This GitHub workflow config has been generated by a script via -# -# haskell-ci '--doctest' '--doctest-version=>0.18' '--hlint' 'github' 'hackage-db.cabal' -# -# To regenerate the script (for example after adjusting tested-with) run -# -# haskell-ci regenerate -# -# For more information, see https://github.com/haskell-CI/haskell-ci -# -# version: 0.13.20210525 -# -# REGENDATA ("0.13.20210525",["--doctest","--doctest-version=>0.18","--hlint","github","hackage-db.cabal"]) -# -name: Haskell-CI -on: - - push - - pull_request -jobs: - linux: - name: Haskell-CI - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-18.04 - container: - image: buildpack-deps:bionic - continue-on-error: ${{ matrix.allow-failure }} - strategy: - matrix: - include: - - compiler: ghc-9.0.1 - allow-failure: false - - compiler: ghc-8.10.4 - allow-failure: false - - compiler: ghc-8.8.4 - allow-failure: false - fail-fast: false - steps: - - name: apt - run: | - apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common - apt-add-repository -y 'ppa:hvr/ghc' - apt-get update - apt-get install -y $CC cabal-install-3.4 - env: - CC: ${{ matrix.compiler }} - - name: Set PATH and environment variables - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - echo "LANG=C.UTF-8" >> $GITHUB_ENV - echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV - echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV - HCDIR=$(echo "/opt/$CC" | sed 's/-/\//') - HCNAME=ghc - HC=$HCDIR/bin/$HCNAME - echo "HC=$HC" >> $GITHUB_ENV - echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV - echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV - echo "CABAL=/opt/cabal/3.4/bin/cabal -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 - echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV - echo "HEADHACKAGE=false" >> $GITHUB_ENV - echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV - echo "GHCJSARITH=0" >> $GITHUB_ENV - env: - CC: ${{ matrix.compiler }} - - name: env - run: | - env - - name: write cabal config - run: | - mkdir -p $CABAL_DIR - cat >> $CABAL_CONFIG < cabal-plan.xz - echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - cabal-plan --version - - name: install doctest - run: | - $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.18' - doctest --version - - name: install hlint - run: | - if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.3 && <3.4' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi - if [ $((HCNUMVER >= 90000)) -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 >= 90000)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi - if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then hlint --version ; fi - - name: checkout - uses: actions/checkout@v2 - with: - path: source - - name: initial cabal.project for sdist - run: | - touch cabal.project - echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project - cat cabal.project - - name: sdist - run: | - mkdir -p sdist - $CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist - - name: unpack - run: | - mkdir -p unpacked - find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; - - name: generate cabal.project - run: | - PKGDIR_hackage_db="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/hackage-db-[0-9.]*')" - echo "PKGDIR_hackage_db=${PKGDIR_hackage_db}" >> $GITHUB_ENV - touch cabal.project - touch cabal.project.local - echo "packages: ${PKGDIR_hackage_db}" >> cabal.project - echo "package hackage-db" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project - cat >> cabal.project <> cabal.project.local - cat cabal.project - cat cabal.project.local - - name: dump install plan - run: | - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all - cabal-plan - - name: cache - uses: actions/cache@v2 - with: - key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} - path: ~/.cabal/store - restore-keys: ${{ runner.os }}-${{ matrix.compiler }}- - - name: install dependencies - run: | - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all - - name: build w/o tests - run: | - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - - name: build - run: | - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - - name: doctest - run: | - cd ${PKGDIR_hackage_db} || false - doctest src - - name: hlint - run: | - if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then (cd ${PKGDIR_hackage_db} && hlint src) ; fi - if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then (cd ${PKGDIR_hackage_db} && hlint example) ; fi - - name: cabal check - run: | - cd ${PKGDIR_hackage_db} || false - ${CABAL} -vnormal check - - name: haddock - run: | - $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - - name: unconstrained build - run: | - rm -f cabal.project.local - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all diff --git a/hackage-db/hackage-db.cabal b/hackage-db/hackage-db.cabal index 728f38b34..d13b0824c 100644 --- a/hackage-db/hackage-db.cabal +++ b/hackage-db/hackage-db.cabal @@ -9,7 +9,7 @@ license: BSD3 license-file: LICENSE author: Peter Simons, Alexander Altman, Ben James, Kevin Quick maintainer: Peter Simons -tested-with: GHC == 8.8.4 || == 8.10.4 || == 9.0.1 +tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.2 category: Distribution homepage: https://github.com/NixOS/hackage-db#readme bug-reports: https://github.com/NixOS/hackage-db/issues diff --git a/language-nix/language-nix.cabal b/language-nix/language-nix.cabal index 0027634c7..208e66dd2 100644 --- a/language-nix/language-nix.cabal +++ b/language-nix/language-nix.cabal @@ -7,7 +7,7 @@ license: BSD3 license-file: LICENSE author: Peter Simons maintainer: simons@cryp.to -tested-with: GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.3, GHC == 8.10.1 +tested-with: GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.2 category: Distribution, Language, Nix homepage: https://github.com/peti/language-nix#readme bug-reports: https://github.com/peti/language-nix/issues diff --git a/shell.nix b/shell.nix index 62705bd18..b2220dc81 100644 --- a/shell.nix +++ b/shell.nix @@ -25,6 +25,7 @@ in pkgs.mkShell { packages = [ ghc pkgs.cabal-install + pkgs.haskell-ci haskellPackages.haskell-language-server (pkgs.lib.getLib pkgs.openssl) ];