Skip to content

Commit bae97cc

Browse files
committed
Support GHC 9.2
1 parent af44e6e commit bae97cc

File tree

2 files changed

+93
-37
lines changed

2 files changed

+93
-37
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 91 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.11.20210220
11+
# version: 0.13.20211030
1212
#
13-
# REGENDATA ("0.11.20210220",["--no-cabal-check","github","lucid.cabal"])
13+
# REGENDATA ("0.13.20211030",["--no-cabal-check","github","lucid.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -22,61 +22,116 @@ on:
2222
- master
2323
jobs:
2424
linux:
25-
name: Haskell-CI - Linux - GHC ${{ matrix.ghc }}
25+
name: Haskell-CI - Linux - ${{ matrix.compiler }}
2626
runs-on: ubuntu-18.04
2727
container:
2828
image: buildpack-deps:bionic
2929
continue-on-error: ${{ matrix.allow-failure }}
3030
strategy:
3131
matrix:
3232
include:
33-
- ghc: 9.0.1
33+
- compiler: ghc-9.2.1
34+
compilerKind: ghc
35+
compilerVersion: 9.2.1
36+
setup-method: ghcup
3437
allow-failure: false
35-
- ghc: 8.10.4
38+
- compiler: ghc-9.0.1
39+
compilerKind: ghc
40+
compilerVersion: 9.0.1
41+
setup-method: hvr-ppa
3642
allow-failure: false
37-
- ghc: 8.8.4
43+
- compiler: ghc-8.10.7
44+
compilerKind: ghc
45+
compilerVersion: 8.10.7
46+
setup-method: ghcup
3847
allow-failure: false
39-
- ghc: 8.6.5
48+
- compiler: ghc-8.8.4
49+
compilerKind: ghc
50+
compilerVersion: 8.8.4
51+
setup-method: hvr-ppa
4052
allow-failure: false
41-
- ghc: 8.4.4
53+
- compiler: ghc-8.6.5
54+
compilerKind: ghc
55+
compilerVersion: 8.6.5
56+
setup-method: hvr-ppa
4257
allow-failure: false
43-
- ghc: 8.2.2
58+
- compiler: ghc-8.4.4
59+
compilerKind: ghc
60+
compilerVersion: 8.4.4
61+
setup-method: hvr-ppa
4462
allow-failure: false
45-
- ghc: 8.0.2
63+
- compiler: ghc-8.2.2
64+
compilerKind: ghc
65+
compilerVersion: 8.2.2
66+
setup-method: hvr-ppa
67+
allow-failure: false
68+
- compiler: ghc-8.0.2
69+
compilerKind: ghc
70+
compilerVersion: 8.0.2
71+
setup-method: hvr-ppa
72+
allow-failure: false
73+
- compiler: ghc-7.10.3
74+
compilerKind: ghc
75+
compilerVersion: 7.10.3
76+
setup-method: hvr-ppa
4677
allow-failure: false
47-
- ghc: 7.10.3
48-
allow-failure: true
4978
fail-fast: false
5079
steps:
5180
- name: apt
5281
run: |
5382
apt-get update
54-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
55-
apt-add-repository -y 'ppa:hvr/ghc'
56-
apt-get update
57-
apt-get install -y ghc-$GHC_VERSION cabal-install-3.4
83+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
84+
if [ "${{ matrix.setup-method }}" = ghcup ]; then
85+
mkdir -p "$HOME/.ghcup/bin"
86+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
87+
chmod a+x "$HOME/.ghcup/bin/ghcup"
88+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
89+
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
90+
else
91+
apt-add-repository -y 'ppa:hvr/ghc'
92+
apt-get update
93+
apt-get install -y "$HCNAME"
94+
mkdir -p "$HOME/.ghcup/bin"
95+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
96+
chmod a+x "$HOME/.ghcup/bin/ghcup"
97+
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
98+
fi
5899
env:
59-
GHC_VERSION: ${{ matrix.ghc }}
100+
HCKIND: ${{ matrix.compilerKind }}
101+
HCNAME: ${{ matrix.compiler }}
102+
HCVER: ${{ matrix.compilerVersion }}
60103
- name: Set PATH and environment variables
61104
run: |
62105
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
63-
echo "LANG=C.UTF-8" >> $GITHUB_ENV
64-
echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
65-
echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
66-
HC=/opt/ghc/$GHC_VERSION/bin/ghc
67-
echo "HC=$HC" >> $GITHUB_ENV
68-
echo "HCPKG=/opt/ghc/$GHC_VERSION/bin/ghc-pkg" >> $GITHUB_ENV
69-
echo "HADDOCK=/opt/ghc/$GHC_VERSION/bin/haddock" >> $GITHUB_ENV
70-
echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
106+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
107+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
108+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
109+
HCDIR=/opt/$HCKIND/$HCVER
110+
if [ "${{ matrix.setup-method }}" = ghcup ]; then
111+
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
112+
echo "HC=$HC" >> "$GITHUB_ENV"
113+
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
114+
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
115+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
116+
else
117+
HC=$HCDIR/bin/$HCKIND
118+
echo "HC=$HC" >> "$GITHUB_ENV"
119+
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
120+
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
121+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
122+
fi
123+
71124
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
72-
echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
73-
echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
74-
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV ; else echo "ARG_BENCH=--disable-benchmarks" >> $GITHUB_ENV ; fi
75-
echo "HEADHACKAGE=false" >> $GITHUB_ENV
76-
echo "ARG_COMPILER=--ghc --with-compiler=$HC" >> $GITHUB_ENV
77-
echo "GHCJSARITH=0" >> $GITHUB_ENV
125+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
126+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
127+
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" ; else echo "ARG_BENCH=--disable-benchmarks" >> "$GITHUB_ENV" ; fi
128+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
129+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
130+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
78131
env:
79-
GHC_VERSION: ${{ matrix.ghc }}
132+
HCKIND: ${{ matrix.compilerKind }}
133+
HCNAME: ${{ matrix.compiler }}
134+
HCVER: ${{ matrix.compilerVersion }}
80135
- name: env
81136
run: |
82137
env
@@ -137,7 +192,8 @@ jobs:
137192
- name: generate cabal.project
138193
run: |
139194
PKGDIR_lucid="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/lucid-[0-9.]*')"
140-
echo "PKGDIR_lucid=${PKGDIR_lucid}" >> $GITHUB_ENV
195+
echo "PKGDIR_lucid=${PKGDIR_lucid}" >> "$GITHUB_ENV"
196+
rm -f cabal.project cabal.project.local
141197
touch cabal.project
142198
touch cabal.project.local
143199
echo "packages: ${PKGDIR_lucid}" >> cabal.project
@@ -155,9 +211,9 @@ jobs:
155211
- name: cache
156212
uses: actions/cache@v2
157213
with:
158-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
214+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
159215
path: ~/.cabal/store
160-
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
216+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
161217
- name: install dependencies
162218
run: |
163219
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all

lucid.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ category: Web
2121
build-type: Simple
2222
cabal-version: >=1.10
2323
extra-source-files: README.md, CHANGELOG.md
24-
tested-with: GHC==7.10.3,GHC==8.0.2,GHC==8.2.2,GHC==8.4.4,GHC==8.6.5,GHC==8.8.4,GHC==8.10.4,GHC==9.0.1
24+
tested-with: GHC==7.10.3,GHC==8.0.2,GHC==8.2.2,GHC==8.4.4,GHC==8.6.5,GHC==8.8.4,GHC==8.10.7,GHC==9.0.1,GHC==9.2.1
2525

2626
library
2727
default-language: Haskell2010
@@ -33,7 +33,7 @@ library
3333
Lucid.Bootstrap
3434

3535
-- GHC boot libraries
36-
build-depends: base >=4.8 && <4.16
36+
build-depends: base >=4.8 && <4.17
3737
, bytestring >=0.10.6.0
3838
, containers >=0.5.6.2
3939
, transformers >=0.4.2.0

0 commit comments

Comments
 (0)