Skip to content

Commit

Permalink
Test with GHC 9.8.1 (#120)
Browse files Browse the repository at this point in the history
- Update 'tested-with' in 'dlist.cabal' to include latest releases of
  GHC: 9.4.8, 9.6.4, 9.8.1
- Update 'haskell-ci' to v0.18
- haskell-ci regenerate
- Use '-Wno-x-partial' to disable the partial function warnings for
  'List.head' and 'List.tail' in 'DListProperties.hs' for GHC >= 9.8
- Fix warning for import of 'liftA2' for GHC >= 9.6
- Fix #108
  • Loading branch information
spl authored Feb 17, 2024
1 parent 700b979 commit cf89951
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
29 changes: 18 additions & 11 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.16.6
# version: 0.18
#
# REGENDATA ("0.16.6",["github","dlist.cabal"])
# REGENDATA ("0.18",["github","dlist.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -28,6 +28,11 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.8.1
compilerKind: ghc
compilerVersion: 9.8.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.2
compilerKind: ghc
compilerVersion: 9.6.2
Expand Down Expand Up @@ -116,18 +121,18 @@ jobs:
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.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
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.1.0 || (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.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
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.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
env:
HCKIND: ${{ matrix.compilerKind }}
Expand All @@ -141,17 +146,19 @@ jobs:
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
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=$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"
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.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.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))')
Expand Down
5 changes: 3 additions & 2 deletions dlist.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ tested-with: GHC==7.0.4
GHC==8.10.7
GHC==9.0.2
GHC==9.2.8
GHC==9.4.5
GHC==9.6.2
GHC==9.4.8
GHC==9.6.4
GHC==9.8.1

source-repository head
type: git
Expand Down
6 changes: 6 additions & 0 deletions tests/DListProperties.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
#endif
{- ORMOLU_ENABLE -}

-- CPP: GHC >= 9.8 for disabling partial function warnings for 'List.head' and
-- 'List.tail'
#if __GLASGOW_HASKELL__ >= 908
{-# OPTIONS_GHC -Wno-x-partial #-}
#endif

#if __GLASGOW_HASKELL__ >= 708
#endif

Expand Down
3 changes: 3 additions & 0 deletions tests/QuickCheckUtil.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ module QuickCheckUtil where

-- CPP: GHC >= 8 for NonEmpty
#if __GLASGOW_HASKELL__ >= 800
-- CPP: GHC >= 9.6 for 'liftA2' exported from Prelude
#if __GLASGOW_HASKELL__ < 906
import Control.Applicative (liftA2)
#endif
import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
import Data.Maybe (mapMaybe)
#endif
Expand Down

0 comments on commit cf89951

Please sign in to comment.