Skip to content

Commit a75d473

Browse files
authored
Merge pull request #6 from andreasabel/ghc-9.12
Support GHC 9.8 - 9.12
2 parents e48eb91 + 5e26ea8 commit a75d473

7 files changed

Lines changed: 284 additions & 8 deletions

File tree

.github/workflows/haskell-ci.yml

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'cabal.project'
4+
#
5+
# To regenerate the script (for example after adjusting tested-with) run
6+
#
7+
# haskell-ci regenerate
8+
#
9+
# For more information, see https://github.com/haskell-CI/haskell-ci
10+
#
11+
# version: 0.19.20241223
12+
#
13+
# REGENDATA ("0.19.20241223",["github","cabal.project"])
14+
#
15+
name: Haskell-CI
16+
on:
17+
push:
18+
branches:
19+
- master
20+
pull_request:
21+
branches:
22+
- master
23+
jobs:
24+
linux:
25+
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26+
runs-on: ubuntu-20.04
27+
timeout-minutes:
28+
60
29+
container:
30+
image: buildpack-deps:jammy
31+
continue-on-error: ${{ matrix.allow-failure }}
32+
strategy:
33+
matrix:
34+
include:
35+
- compiler: ghc-9.12.1
36+
compilerKind: ghc
37+
compilerVersion: 9.12.1
38+
setup-method: ghcup
39+
allow-failure: false
40+
- compiler: ghc-9.10.1
41+
compilerKind: ghc
42+
compilerVersion: 9.10.1
43+
setup-method: ghcup
44+
allow-failure: false
45+
- compiler: ghc-9.8.2
46+
compilerKind: ghc
47+
compilerVersion: 9.8.2
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.6.6
51+
compilerKind: ghc
52+
compilerVersion: 9.6.6
53+
setup-method: ghcup
54+
allow-failure: false
55+
- compiler: ghc-9.4.8
56+
compilerKind: ghc
57+
compilerVersion: 9.4.8
58+
setup-method: ghcup
59+
allow-failure: false
60+
- compiler: ghc-9.2.8
61+
compilerKind: ghc
62+
compilerVersion: 9.2.8
63+
setup-method: ghcup
64+
allow-failure: false
65+
fail-fast: false
66+
steps:
67+
- name: apt-get install
68+
run: |
69+
apt-get update
70+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
71+
- name: Install GHCup
72+
run: |
73+
mkdir -p "$HOME/.ghcup/bin"
74+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
75+
chmod a+x "$HOME/.ghcup/bin/ghcup"
76+
- name: Install cabal-install
77+
run: |
78+
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
79+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
80+
- name: Install GHC (GHCup)
81+
if: matrix.setup-method == 'ghcup'
82+
run: |
83+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
84+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
85+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
86+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
87+
echo "HC=$HC" >> "$GITHUB_ENV"
88+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
89+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
90+
env:
91+
HCKIND: ${{ matrix.compilerKind }}
92+
HCNAME: ${{ matrix.compiler }}
93+
HCVER: ${{ matrix.compilerVersion }}
94+
- name: Set PATH and environment variables
95+
run: |
96+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
97+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
98+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
99+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
100+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
101+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
102+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
103+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
104+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
105+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
106+
env:
107+
HCKIND: ${{ matrix.compilerKind }}
108+
HCNAME: ${{ matrix.compiler }}
109+
HCVER: ${{ matrix.compilerVersion }}
110+
- name: env
111+
run: |
112+
env
113+
- name: write cabal config
114+
run: |
115+
mkdir -p $CABAL_DIR
116+
cat >> $CABAL_CONFIG <<EOF
117+
remote-build-reporting: anonymous
118+
write-ghc-environment-files: never
119+
remote-repo-cache: $CABAL_DIR/packages
120+
logs-dir: $CABAL_DIR/logs
121+
world-file: $CABAL_DIR/world
122+
extra-prog-path: $CABAL_DIR/bin
123+
symlink-bindir: $CABAL_DIR/bin
124+
installdir: $CABAL_DIR/bin
125+
build-summary: $CABAL_DIR/logs/build.log
126+
store-dir: $CABAL_DIR/store
127+
install-dirs user
128+
prefix: $CABAL_DIR
129+
repository hackage.haskell.org
130+
url: http://hackage.haskell.org/
131+
EOF
132+
cat >> $CABAL_CONFIG <<EOF
133+
program-default-options
134+
ghc-options: $GHCJOBS +RTS -M3G -RTS
135+
EOF
136+
cat $CABAL_CONFIG
137+
- name: versions
138+
run: |
139+
$HC --version || true
140+
$HC --print-project-git-commit-id || true
141+
$CABAL --version || true
142+
- name: update cabal index
143+
run: |
144+
$CABAL v2-update -v
145+
- name: install cabal-plan
146+
run: |
147+
mkdir -p $HOME/.cabal/bin
148+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
149+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
150+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
151+
rm -f cabal-plan.xz
152+
chmod a+x $HOME/.cabal/bin/cabal-plan
153+
cabal-plan --version
154+
- name: checkout
155+
uses: actions/checkout@v4
156+
with:
157+
path: source
158+
- name: initial cabal.project for sdist
159+
run: |
160+
touch cabal.project
161+
echo "packages: $GITHUB_WORKSPACE/source/chell" >> cabal.project
162+
echo "packages: $GITHUB_WORKSPACE/source/chell-hunit" >> cabal.project
163+
echo "packages: $GITHUB_WORKSPACE/source/chell-quickcheck" >> cabal.project
164+
cat cabal.project
165+
- name: sdist
166+
run: |
167+
mkdir -p sdist
168+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
169+
- name: unpack
170+
run: |
171+
mkdir -p unpacked
172+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
173+
- name: generate cabal.project
174+
run: |
175+
PKGDIR_chell="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/chell-[0-9.]*')"
176+
echo "PKGDIR_chell=${PKGDIR_chell}" >> "$GITHUB_ENV"
177+
PKGDIR_chell_hunit="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/chell-hunit-[0-9.]*')"
178+
echo "PKGDIR_chell_hunit=${PKGDIR_chell_hunit}" >> "$GITHUB_ENV"
179+
PKGDIR_chell_quickcheck="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/chell-quickcheck-[0-9.]*')"
180+
echo "PKGDIR_chell_quickcheck=${PKGDIR_chell_quickcheck}" >> "$GITHUB_ENV"
181+
rm -f cabal.project cabal.project.local
182+
touch cabal.project
183+
touch cabal.project.local
184+
echo "packages: ${PKGDIR_chell}" >> cabal.project
185+
echo "packages: ${PKGDIR_chell_hunit}" >> cabal.project
186+
echo "packages: ${PKGDIR_chell_quickcheck}" >> cabal.project
187+
echo "package chell" >> cabal.project
188+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
189+
echo "package chell-hunit" >> cabal.project
190+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
191+
echo "package chell-quickcheck" >> cabal.project
192+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
193+
cat >> cabal.project <<EOF
194+
EOF
195+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(chell|chell-hunit|chell-quickcheck)$/; }' >> cabal.project.local
196+
cat cabal.project
197+
cat cabal.project.local
198+
- name: dump install plan
199+
run: |
200+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
201+
cabal-plan
202+
- name: restore cache
203+
uses: actions/cache/restore@v4
204+
with:
205+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
206+
path: ~/.cabal/store
207+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
208+
- name: install dependencies
209+
run: |
210+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
211+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
212+
- name: build w/o tests
213+
run: |
214+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
215+
- name: build
216+
run: |
217+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
218+
- name: cabal check
219+
run: |
220+
cd ${PKGDIR_chell} || false
221+
${CABAL} -vnormal check
222+
cd ${PKGDIR_chell_hunit} || false
223+
${CABAL} -vnormal check
224+
cd ${PKGDIR_chell_quickcheck} || false
225+
${CABAL} -vnormal check
226+
- name: haddock
227+
run: |
228+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
229+
- name: unconstrained build
230+
run: |
231+
rm -f cabal.project.local
232+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
233+
- name: save cache
234+
if: always()
235+
uses: actions/cache/save@v4
236+
with:
237+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
238+
path: ~/.cabal/store

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ dist-*
33
.ghc.*
44
result
55
result-*
6+
.stack-work/
7+
stack*.yaml.lock

cabal.haskell-ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
branches: master

chell-hunit/chell-hunit.cabal

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,20 @@ description:
1818

1919
extra-source-files: *.md
2020

21+
tested-with:
22+
GHC == 9.12.1
23+
GHC == 9.10.1
24+
GHC == 9.8.2
25+
GHC == 9.6.6
26+
GHC == 9.4.8
27+
GHC == 9.2.8
28+
2129
library
2230
default-language: GHC2021
2331
ghc-options: -Wall
2432

2533
build-depends:
26-
, base ^>= 4.16 || ^>= 4.17 || ^>= 4.18
34+
, base ^>= 4.16 || ^>= 4.17 || ^>= 4.18 || ^>= 4.19 || ^>= 4.20 || ^>= 4.21
2735
, chell ^>= 0.5
2836
, HUnit ^>= 1.6.2
2937

chell-quickcheck/chell-quickcheck.cabal

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cabal-version: 3.0
22

33
name: chell-quickcheck
44
version: 0.2.5.4
5+
x-revision: 2
56

67
synopsis: QuickCheck support for Chell
78
category: Testing
@@ -18,15 +19,23 @@ description:
1819

1920
extra-source-files: *.md
2021

22+
tested-with:
23+
GHC == 9.12.1
24+
GHC == 9.10.1
25+
GHC == 9.8.2
26+
GHC == 9.6.6
27+
GHC == 9.4.8
28+
GHC == 9.2.8
29+
2130
library
2231
default-language: GHC2021
2332
ghc-options: -Wall
2433

2534
build-depends:
26-
, base ^>= 4.16 || ^>= 4.17 || ^>= 4.18
35+
, base ^>= 4.16 || ^>= 4.17 || ^>= 4.18 || ^>= 4.19 || ^>= 4.20 || ^>= 4.21
2736
, chell ^>= 0.5
2837
, QuickCheck ^>= 2.14.2
29-
, random ^>= 1.2.1
38+
, random ^>= 1.2.1 || ^>= 1.3.0
3039

3140
exposed-modules:
3241
Test.Chell.QuickCheck

chell/chell.cabal

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cabal-version: 3.0
22

33
name: chell
44
version: 0.5.0.2
5+
x-revision: 4
56

67
synopsis: A simple and intuitive library for automated testing.
78
category: Testing
@@ -20,6 +21,14 @@ description:
2021

2122
extra-source-files: *.md
2223

24+
tested-with:
25+
GHC == 9.12.1
26+
GHC == 9.10.1
27+
GHC == 9.8.2
28+
GHC == 9.6.6
29+
GHC == 9.4.8
30+
GHC == 9.2.8
31+
2332
flag color-output
2433
description: Enable colored output in test results
2534
default: True
@@ -29,18 +38,18 @@ library
2938
ghc-options: -Wall
3039

3140
build-depends:
32-
, base ^>= 4.16 || ^>= 4.17 || ^>= 4.18
41+
, base ^>= 4.16 || ^>= 4.17 || ^>= 4.18 || ^>= 4.19 || ^>= 4.20 || ^>= 4.21
3342
, bytestring ^>= 0.11.4 || ^>= 0.12
3443
, options ^>= 1.2.1
3544
, patience ^>= 0.3
36-
, random ^>= 1.2.1
37-
, template-haskell ^>=2.18 || ^>= 2.19 || ^>= 2.20
38-
, text ^>= 1.2.5 || ^>= 2.0
45+
, random ^>= 1.2.1 || ^>= 1.3.0
46+
, template-haskell ^>=2.18 || ^>= 2.19 || ^>= 2.20 || ^>= 2.21 || ^>= 2.22 || ^>= 2.23
47+
, text ^>= 1.2.5 || ^>= 2.0 || ^>= 2.1
3948
, transformers ^>= 0.5.6 || ^>= 0.6
4049

4150
if flag(color-output)
4251
build-depends:
43-
, ansi-terminal ^>= 1.0
52+
, ansi-terminal ^>= 1.0 || ^>= 1.1
4453

4554
exposed-modules:
4655
Test.Chell

stack.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resolver: nightly-2024-10-21
2+
3+
packages:
4+
- chell
5+
- chell-hunit
6+
- chell-quickcheck
7+
8+
extra-deps:
9+
- patience-0.3

0 commit comments

Comments
 (0)