Skip to content

Commit bf5bf9d

Browse files
authored
Add Haskell CI for GHC 8.0 - 9.8; allow containers-0.7 (#184)
* Add Haskell CI for GHC 7.10 - 9.8; allow containers-0.7 Closes #182. * Update stack.yaml; switch off tests The tests are broken see #183 * Restrict tested-with to GHC 8.0 - 9.8
1 parent 7cd5f71 commit bf5bf9d

File tree

6 files changed

+315
-33
lines changed

6 files changed

+315
-33
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 287 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,287 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'haskeline.cabal'
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/andreasabel/haskell-ci
10+
#
11+
# version: 0.17.20230928
12+
#
13+
# REGENDATA ("0.17.20230928",["github","haskeline.cabal"])
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:focal
31+
continue-on-error: ${{ matrix.allow-failure }}
32+
strategy:
33+
matrix:
34+
include:
35+
- compiler: ghc-9.8.0.20230919
36+
compilerKind: ghc
37+
compilerVersion: 9.8.0.20230919
38+
setup-method: ghcup
39+
allow-failure: true
40+
- compiler: ghc-9.6.3
41+
compilerKind: ghc
42+
compilerVersion: 9.6.3
43+
setup-method: ghcup
44+
allow-failure: false
45+
- compiler: ghc-9.4.7
46+
compilerKind: ghc
47+
compilerVersion: 9.4.7
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.2.8
51+
compilerKind: ghc
52+
compilerVersion: 9.2.8
53+
setup-method: ghcup
54+
allow-failure: false
55+
- compiler: ghc-9.0.2
56+
compilerKind: ghc
57+
compilerVersion: 9.0.2
58+
setup-method: ghcup
59+
allow-failure: false
60+
- compiler: ghc-8.10.7
61+
compilerKind: ghc
62+
compilerVersion: 8.10.7
63+
setup-method: ghcup
64+
allow-failure: false
65+
- compiler: ghc-8.8.4
66+
compilerKind: ghc
67+
compilerVersion: 8.8.4
68+
setup-method: hvr-ppa
69+
allow-failure: false
70+
- compiler: ghc-8.6.5
71+
compilerKind: ghc
72+
compilerVersion: 8.6.5
73+
setup-method: hvr-ppa
74+
allow-failure: false
75+
- compiler: ghc-8.4.4
76+
compilerKind: ghc
77+
compilerVersion: 8.4.4
78+
setup-method: hvr-ppa
79+
allow-failure: false
80+
- compiler: ghc-8.2.2
81+
compilerKind: ghc
82+
compilerVersion: 8.2.2
83+
setup-method: hvr-ppa
84+
allow-failure: false
85+
- compiler: ghc-8.0.2
86+
compilerKind: ghc
87+
compilerVersion: 8.0.2
88+
setup-method: hvr-ppa
89+
allow-failure: false
90+
fail-fast: false
91+
steps:
92+
- name: apt
93+
run: |
94+
apt-get update
95+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
96+
if [ "${{ matrix.setup-method }}" = ghcup ]; then
97+
mkdir -p "$HOME/.ghcup/bin"
98+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
99+
chmod a+x "$HOME/.ghcup/bin/ghcup"
100+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
101+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
102+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
103+
else
104+
apt-add-repository -y 'ppa:hvr/ghc'
105+
apt-get update
106+
apt-get install -y "$HCNAME"
107+
mkdir -p "$HOME/.ghcup/bin"
108+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
109+
chmod a+x "$HOME/.ghcup/bin/ghcup"
110+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
111+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
112+
fi
113+
env:
114+
HCKIND: ${{ matrix.compilerKind }}
115+
HCNAME: ${{ matrix.compiler }}
116+
HCVER: ${{ matrix.compilerVersion }}
117+
- name: Set PATH and environment variables
118+
run: |
119+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
120+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
121+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
122+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
123+
HCDIR=/opt/$HCKIND/$HCVER
124+
if [ "${{ matrix.setup-method }}" = ghcup ]; then
125+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
126+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
127+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
128+
echo "HC=$HC" >> "$GITHUB_ENV"
129+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
130+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
131+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
132+
else
133+
HC=$HCDIR/bin/$HCKIND
134+
echo "HC=$HC" >> "$GITHUB_ENV"
135+
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
136+
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
137+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
138+
fi
139+
140+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
141+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
142+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
143+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
144+
if [ $((HCNUMVER >= 90800)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
145+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
146+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
147+
env:
148+
HCKIND: ${{ matrix.compilerKind }}
149+
HCNAME: ${{ matrix.compiler }}
150+
HCVER: ${{ matrix.compilerVersion }}
151+
- name: env
152+
run: |
153+
env
154+
- name: write cabal config
155+
run: |
156+
mkdir -p $CABAL_DIR
157+
cat >> $CABAL_CONFIG <<EOF
158+
remote-build-reporting: anonymous
159+
write-ghc-environment-files: never
160+
remote-repo-cache: $CABAL_DIR/packages
161+
logs-dir: $CABAL_DIR/logs
162+
world-file: $CABAL_DIR/world
163+
extra-prog-path: $CABAL_DIR/bin
164+
symlink-bindir: $CABAL_DIR/bin
165+
installdir: $CABAL_DIR/bin
166+
build-summary: $CABAL_DIR/logs/build.log
167+
store-dir: $CABAL_DIR/store
168+
install-dirs user
169+
prefix: $CABAL_DIR
170+
repository hackage.haskell.org
171+
url: http://hackage.haskell.org/
172+
EOF
173+
if $HEADHACKAGE; then
174+
cat >> $CABAL_CONFIG <<EOF
175+
repository head.hackage.ghc.haskell.org
176+
url: https://ghc.gitlab.haskell.org/head.hackage/
177+
secure: True
178+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
179+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
180+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
181+
key-threshold: 3
182+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
183+
EOF
184+
fi
185+
cat >> $CABAL_CONFIG <<EOF
186+
program-default-options
187+
ghc-options: $GHCJOBS +RTS -M3G -RTS
188+
EOF
189+
cat $CABAL_CONFIG
190+
- name: versions
191+
run: |
192+
$HC --version || true
193+
$HC --print-project-git-commit-id || true
194+
$CABAL --version || true
195+
- name: update cabal index
196+
run: |
197+
$CABAL v2-update -v
198+
- name: install cabal-plan
199+
run: |
200+
mkdir -p $HOME/.cabal/bin
201+
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
202+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
203+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
204+
rm -f cabal-plan.xz
205+
chmod a+x $HOME/.cabal/bin/cabal-plan
206+
cabal-plan --version
207+
- name: checkout
208+
uses: actions/checkout@v4
209+
with:
210+
path: source
211+
- name: initial cabal.project for sdist
212+
run: |
213+
touch cabal.project
214+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
215+
cat cabal.project
216+
- name: sdist
217+
run: |
218+
mkdir -p sdist
219+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
220+
- name: unpack
221+
run: |
222+
mkdir -p unpacked
223+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
224+
- name: generate cabal.project
225+
run: |
226+
PKGDIR_haskeline="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/haskeline-[0-9.]*')"
227+
echo "PKGDIR_haskeline=${PKGDIR_haskeline}" >> "$GITHUB_ENV"
228+
rm -f cabal.project cabal.project.local
229+
touch cabal.project
230+
touch cabal.project.local
231+
echo "packages: ${PKGDIR_haskeline}" >> cabal.project
232+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package haskeline" >> cabal.project ; fi
233+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
234+
cat >> cabal.project <<EOF
235+
EOF
236+
if $HEADHACKAGE; then
237+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
238+
fi
239+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(haskeline)$/; }' >> cabal.project.local
240+
cat cabal.project
241+
cat cabal.project.local
242+
- name: dump install plan
243+
run: |
244+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
245+
cabal-plan
246+
- name: restore cache
247+
uses: actions/cache/restore@v3
248+
with:
249+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
250+
path: ~/.cabal/store
251+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
252+
- name: install dependencies
253+
run: |
254+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
255+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
256+
- name: build w/o tests
257+
run: |
258+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
259+
- name: build
260+
run: |
261+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
262+
- name: cabal check
263+
run: |
264+
cd ${PKGDIR_haskeline} || false
265+
${CABAL} -vnormal check
266+
- name: haddock
267+
run: |
268+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
269+
- name: unconstrained build
270+
run: |
271+
rm -f cabal.project.local
272+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
273+
- name: prepare for constraint sets
274+
run: |
275+
rm -f cabal.project.local
276+
- name: constraint set containers-0.7
277+
run: |
278+
if [ $((HCNUMVER >= 80200 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>= 0.7' all --dry-run ; fi
279+
if [ $((HCNUMVER >= 80200 && HCNUMVER < 90800)) -ne 0 ] ; then cabal-plan topo | sort ; fi
280+
if [ $((HCNUMVER >= 80200 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>= 0.7' --dependencies-only -j2 all ; fi
281+
if [ $((HCNUMVER >= 80200 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>= 0.7' all ; fi
282+
- name: save cache
283+
uses: actions/cache/save@v3
284+
if: always()
285+
with:
286+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
287+
path: ~/.cabal/store

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ dist-install
44
ghc.mk
55
.stack-work
66
myhist
7+
/dist-newstyle/
8+
/stack.yaml.lock

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

cabal.haskell-ci

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
branches: master
2+
3+
run-tests: False
4+
5+
constraint-set containers-0.7
6+
ghc: >= 8.2 && < 9.7
7+
constraints: containers ^>= 0.7
8+
tests: True
9+
run-tests: False

haskeline.cabal

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,25 @@ Homepage: https://github.com/judah/haskeline
1919
Bug-Reports: https://github.com/judah/haskeline/issues
2020
Stability: Stable
2121
Build-Type: Simple
22+
23+
tested-with:
24+
GHC == 9.8.0
25+
GHC == 9.6.3
26+
GHC == 9.4.7
27+
GHC == 9.2.8
28+
GHC == 9.0.2
29+
GHC == 8.10.7
30+
GHC == 8.8.4
31+
GHC == 8.6.5
32+
GHC == 8.4.4
33+
GHC == 8.2.2
34+
GHC == 8.0.2
35+
2236
extra-source-files: examples/Test.hs Changelog includes/*.h
2337

2438
source-repository head
2539
type: git
26-
location: git://github.com/judah/haskeline.git
40+
location: https://github.com/judah/haskeline.git
2741

2842
-- There are three main advantages to the terminfo backend over the portable,
2943
-- "dumb" alternative. First, it enables more efficient control sequences

stack.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
resolver: lts-13.6
1+
resolver: lts-20.26
22

33
packages:
44
- .
55

6-
extra-deps:
7-
- exceptions-0.10.0
8-
96
ghc-options:
10-
"$locals": -Wall -Werror
7+
"$locals": -Wall

0 commit comments

Comments
 (0)