Skip to content

Commit

Permalink
Sync tested GHC versions and update haskell-ci workflow
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
sternenseemann committed Jul 21, 2022
1 parent be7a6eb commit fad357e
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 457 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci-skip-package-map.patch
Original file line number Diff line number Diff line change
@@ -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
43 changes: 39 additions & 4 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -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
#
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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 <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(cabal2nix)$/; }' >> 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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cabal2nix/cabal2nix.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ author: Peter Simons <[email protected]>
-- list all contributors: git log --pretty='%an' | sort | uniq
maintainer: sternenseemann <[email protected]>
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
Expand Down
13 changes: 0 additions & 13 deletions distribution-nixpkgs/.github/workflows/ci-skip-package-map.patch

This file was deleted.

244 changes: 0 additions & 244 deletions distribution-nixpkgs/.github/workflows/haskell-ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion distribution-nixpkgs/distribution-nixpkgs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license: BSD3
license-file: LICENSE
author: Peter Simons <[email protected]>
maintainer: sternenseemann <[email protected]>
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
Expand Down
Loading

0 comments on commit fad357e

Please sign in to comment.