Skip to content

Commit

Permalink
Merge pull request #536 from NixOS/update-ci
Browse files Browse the repository at this point in the history
ci: test on GHC 9.0.2
  • Loading branch information
sternenseemann authored Feb 26, 2022
2 parents 9cbf11b + 7e0ea46 commit 39da11f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 37 deletions.
53 changes: 17 additions & 36 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# 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' '--ghcup-jobs-jobs' '== 8.10.7' 'github' 'cabal2nix.cabal'
# haskell-ci '--branches' 'master' '--doctest' '--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen' 'github' 'cabal2nix.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.20211116
# version: 0.14.1
#
# REGENDATA ("0.13.20211116",["--branches","master","--doctest","--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","--ghcup-jobs-jobs","== 8.10.7","github","cabal2nix.cabal"])
# REGENDATA ("0.14.1",["--branches","master","--doctest","--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","github","cabal2nix.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -32,10 +32,10 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.0.1
- compiler: ghc-9.0.2
compilerKind: ghc
compilerVersion: 9.0.1
setup-method: hvr-ppa
compilerVersion: 9.0.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.7
compilerKind: ghc
Expand All @@ -48,21 +48,11 @@ jobs:
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.3/x86_64-linux-ghcup-0.1.17.3 > "$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.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
fi
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$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
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -74,20 +64,11 @@ 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/$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
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"
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 @@ -210,7 +191,7 @@ jobs:
- name: doctest
run: |
cd ${PKGDIR_cabal2nix} || false
doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen src
doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src
- name: cabal check
run: |
cd ${PKGDIR_cabal2nix} || false
Expand Down
2 changes: 1 addition & 1 deletion 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.10.7 || == 9.0.1
tested-with: GHC == 8.10.7 || == 9.0.2
category: Distribution, Nix
homepage: https://github.com/nixos/cabal2nix#readme
bug-reports: https://github.com/nixos/cabal2nix/issues
Expand Down

0 comments on commit 39da11f

Please sign in to comment.