Skip to content

Commit 2a9d772

Browse files
committed
Bump CI to latest: GHC 9.12.0 9.10.1 9.8.4, restore Haskell-CI
1 parent 0fb3cf2 commit 2a9d772

File tree

5 files changed

+312
-8
lines changed

5 files changed

+312
-8
lines changed

.github/workflows/haskell-ci.yml

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

.github/workflows/stack.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,36 @@ jobs:
2222
include:
2323

2424
- os: macos-latest
25-
ghc: 9.8.2
26-
resolver: nightly-2024-10-11
25+
ghc: 9.10.1
26+
resolver: nightly-2024-12-12
27+
- os: macos-latest
28+
ghc: 9.8.4
29+
resolver: lts-23.0
2730
- os: macos-latest
2831
ghc: 9.2.8
2932
resolver: lts-20.26
3033
# GHC < 9.2 not supported on macos-14 ARM runner
3134
# https://github.com/haskell-actions/setup/issues/77
3235

3336
- os: windows-latest
34-
ghc: 9.8.2
35-
resolver: nightly-2024-10-11
37+
ghc: 9.10.1
38+
resolver: nightly-2024-12-12
39+
- os: windows-latest
40+
ghc: 9.8.4
41+
resolver: lts-23.0
3642
- os: windows-latest
3743
ghc: 8.4.4
3844
resolver: lts-12.26
3945

4046
- os: ubuntu-latest
41-
ghc: 9.8.2
42-
resolver: nightly-2024-10-11
47+
ghc: 9.10.1
48+
resolver: nightly-2024-12-12
49+
- os: ubuntu-latest
50+
ghc: 9.8.4
51+
resolver: lts-23.0
4352
- os: ubuntu-latest
4453
ghc: 9.6.6
45-
resolver: lts-22.37
54+
resolver: lts-22.43
4655
- os: ubuntu-latest
4756
ghc: 9.4.8
4857
resolver: lts-21.25

cabal.haskell-ci

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
branches: main
2+
tests: >= 8.4
3+
-- tests need directory >= 1.3.1.0 which ships from GHC 8.4 on
4+
-- so we don't bother to test on these old GHC versions

unix-compat.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ category: System
1616
build-type: Simple
1717

1818
tested-with:
19+
GHC == 9.12.0
1920
GHC == 9.10.1
20-
GHC == 9.8.2
21+
GHC == 9.8.4
2122
GHC == 9.6.6
2223
GHC == 9.4.8
2324
GHC == 9.2.8

0 commit comments

Comments
 (0)