Skip to content

Commit

Permalink
Bump CI to GHC 9.8.1
Browse files Browse the repository at this point in the history
Also restores CI for the examples.
  • Loading branch information
andreasabel committed Oct 14, 2023
1 parent 26af633 commit 49e73ef
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 105 deletions.
134 changes: 55 additions & 79 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'cabal-doctest.cabal'
# haskell-ci 'github' 'cabal.project'
#
# 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
# For more information, see https://github.com/andreasabel/haskell-ci
#
# version: 0.16.6.20230729
# version: 0.17.20231012
#
# REGENDATA ("0.16.6.20230729",["github","cabal-doctest.cabal"])
# REGENDATA ("0.17.20231012",["github","cabal.project"])
#
name: Haskell-CI
on:
push:
branches:
- master
- ci-*
pull_request:
branches:
- master
- ci-*
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:focal
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.6.2
- compiler: ghc-9.8.1
compilerKind: ghc
compilerVersion: 9.6.2
compilerVersion: 9.8.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.5
- compiler: ghc-9.6.3
compilerKind: ghc
compilerVersion: 9.4.5
compilerVersion: 9.6.3
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.7
compilerKind: ghc
compilerVersion: 9.4.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
Expand All @@ -62,79 +65,40 @@ jobs:
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.6.5
compilerKind: ghc
compilerVersion: 8.6.5
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.4.4
compilerKind: ghc
compilerVersion: 8.4.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.2.2
compilerKind: ghc
compilerVersion: 8.2.2
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.0.2
compilerKind: ghc
compilerVersion: 8.0.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.10.3
compilerKind: ghc
compilerVersion: 7.10.3
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.8.4
compilerKind: ghc
compilerVersion: 7.8.4
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.6.3
compilerKind: ghc
compilerVersion: 7.6.3
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.4.2
compilerKind: ghc
compilerVersion: 7.4.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.2.2
compilerKind: ghc
compilerVersion: 7.2.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.0.4
compilerKind: ghc
compilerVersion: 7.0.4
setup-method: hvr-ppa
setup-method: ghcup
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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$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.1.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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$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.7.yaml;
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -146,20 +110,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/$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.10.1.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.1.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.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"
Expand Down Expand Up @@ -216,13 +173,15 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- 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/." >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/simple-example" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/multiple-components-example" >> cabal.project
cat cabal.project
- name: sdist
run: |
Expand All @@ -236,15 +195,25 @@ jobs:
run: |
PKGDIR_cabal_doctest="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/cabal-doctest-[0-9.]*')"
echo "PKGDIR_cabal_doctest=${PKGDIR_cabal_doctest}" >> "$GITHUB_ENV"
PKGDIR_simple_example="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/simple-example-[0-9.]*')"
echo "PKGDIR_simple_example=${PKGDIR_simple_example}" >> "$GITHUB_ENV"
PKGDIR_multiple_components_example="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/multiple-components-example-[0-9.]*')"
echo "PKGDIR_multiple_components_example=${PKGDIR_multiple_components_example}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_cabal_doctest}" >> cabal.project
echo "packages: ${PKGDIR_simple_example}" >> cabal.project
echo "packages: ${PKGDIR_multiple_components_example}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package cabal-doctest" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package simple-example" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package multiple-components-example" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(cabal-doctest)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(cabal-doctest|multiple-components-example|simple-example)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand All @@ -267,13 +236,20 @@ jobs:
- 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: cabal check
run: |
cd ${PKGDIR_cabal_doctest} || false
${CABAL} -vnormal check
cd ${PKGDIR_simple_example} || false
${CABAL} -vnormal check
cd ${PKGDIR_multiple_components_example} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
- name: unconstrained build
run: |
rm -f cabal.project.local
Expand Down
18 changes: 10 additions & 8 deletions cabal-doctest.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ extra-source-files:
README.md

tested-with:
GHC == 9.6.2
GHC == 9.4.5
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand All @@ -31,12 +32,13 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3
GHC == 7.8.4
GHC == 7.6.3
GHC == 7.4.2
GHC == 7.2.2
GHC == 7.0.4
-- 2023-10-14: Drop CI for GHC 7.x
-- GHC == 7.10.3
-- GHC == 7.8.4
-- GHC == 7.6.3
-- GHC == 7.4.2
-- GHC == 7.2.2
-- GHC == 7.0.4

source-repository head
type: git
Expand Down
7 changes: 5 additions & 2 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
branches: master ci-*
jobs-selection: any
branches: master
-- jobs-selection: any

-- Older haddocks error out for various reasons
haddock: >= 9.4
17 changes: 9 additions & 8 deletions multiple-components-example/multiple-components-example.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ category: Example
build-type: Custom

tested-with:
GHC == 9.6.2
GHC == 9.4.5
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand All @@ -27,12 +28,12 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3
GHC == 7.8.4
GHC == 7.6.3
GHC == 7.4.2
GHC == 7.2.2
GHC == 7.0.4
-- GHC == 7.10.3
-- GHC == 7.8.4
-- GHC == 7.6.3
-- GHC == 7.4.2
-- GHC == 7.2.2
-- GHC == 7.0.4

custom-setup
setup-depends:
Expand Down
17 changes: 9 additions & 8 deletions simple-example/simple-example.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ build-type: Custom
cabal-version: 1.12

tested-with:
GHC == 9.6.2
GHC == 9.4.5
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand All @@ -26,12 +27,12 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3
GHC == 7.8.4
GHC == 7.6.3
GHC == 7.4.2
GHC == 7.2.2
GHC == 7.0.4
-- GHC == 7.10.3
-- GHC == 7.8.4
-- GHC == 7.6.3
-- GHC == 7.4.2
-- GHC == 7.2.2
-- GHC == 7.0.4

custom-setup
setup-depends:
Expand Down

0 comments on commit 49e73ef

Please sign in to comment.