Skip to content

Commit

Permalink
Merge pull request #620 from NixOS/ci
Browse files Browse the repository at this point in the history
.github: update GHCs to test on
  • Loading branch information
sternenseemann authored May 7, 2024
2 parents f8e6bf7 + 05c35eb commit 7816d64
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 51 deletions.
76 changes: 29 additions & 47 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.17.20231219
# version: 0.19.20240501
#
# REGENDATA ("0.17.20231219",["--branches","master","--github-patches",".github/workflows/ci-skip-package-map.patch","--doctest","--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","--doctest-jobs=>= 8.8 && < 9.4","github","cabal.project"])
# REGENDATA ("0.19.20240501",["--branches","master","--github-patches",".github/workflows/ci-skip-package-map.patch","--doctest","--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","--doctest-jobs=>= 8.8 && < 9.4","github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -27,11 +27,16 @@ 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.6.5
compilerKind: ghc
compilerVersion: 9.6.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.8
Expand All @@ -52,32 +57,18 @@ jobs:
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
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.20.0/x86_64-linux-ghcup-0.1.20.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)
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.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
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"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$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)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -89,22 +80,13 @@ jobs:
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/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
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"
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.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
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"
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"
Expand Down Expand Up @@ -152,9 +134,9 @@ jobs:
run: |
$CABAL v2-update -v
- name: cache (tools)
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-65c9c5ff
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-dd324315
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
Expand All @@ -167,16 +149,16 @@ jobs:
cabal-plan --version
- name: install doctest
run: |
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20' ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest --version ; fi
- name: save cache (tools)
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-65c9c5ff
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-dd324315
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -230,7 +212,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
Expand Down Expand Up @@ -276,7 +258,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 }}
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 || == 9.2.8 || == 9.4.8
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.5
category: Distribution, Nix
homepage: https://github.com/nixos/cabal2nix#readme
bug-reports: https://github.com/nixos/cabal2nix/issues
Expand Down
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.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.5
category: Distribution, Nix
homepage: https://github.com/NixOS/cabal2nix/tree/master/distribution-nixpkgs#readme
bug-reports: https://github.com/NixOS/cabal2nix/issues
Expand Down
2 changes: 1 addition & 1 deletion hackage-db/hackage-db.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license: BSD3
license-file: LICENSE
author: Peter Simons, Alexander Altman, Ben James, Kevin Quick
maintainer: sternenseemann <[email protected]>
tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.5
category: Distribution
homepage: https://github.com/NixOS/cabal2nix/tree/master/hackage-db#readme
bug-reports: https://github.com/NixOS/cabal2nix/issues
Expand Down
2 changes: 1 addition & 1 deletion language-nix/language-nix.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: BSD3
license-file: LICENSE
author: Peter Simons
maintainer: [email protected]
tested-with: GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8
tested-with: GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.5
category: Distribution, Language, Nix
homepage: https://github.com/NixOS/cabal2nix/tree/master/language-nix#readme
bug-reports: https://github.com/NixOS/cabal2nix/issues
Expand Down

0 comments on commit 7816d64

Please sign in to comment.