Skip to content

Commit 0697fd9

Browse files
committed
Modernized Haskell CI toolchain
1 parent 0ef3d0f commit 0697fd9

1 file changed

Lines changed: 28 additions & 17 deletions

File tree

.github/workflows/haskell-ci.yml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
#
1313
# REGENDATA ("0.19.20260624",["github","--distribution","jammy","direct-sqlite.cabal"])
1414
#
15+
# Manually updated to:
16+
# - use Ubuntu 26.04 (Resolute)
17+
# - use GHCup 0.2.6.2
18+
# - use cabal-install 3.16.1.0
19+
# - use unprefixed Cabal commands without 'v2-' prefix
20+
# - exclude libtinfo5, which is unavailable on Resolute
21+
# - locate GHC tools via the GHCup installation directory
22+
# - configure hsc2hs to use the BFD linker, since Gold is unavailable on Resolute
23+
#
1524
name: Haskell-CI
1625
on:
1726
- push
@@ -21,11 +30,11 @@ on:
2130
jobs:
2231
linux:
2332
name: Haskell-CI - Linux - ${{ matrix.compiler }}
24-
runs-on: ubuntu-24.04
33+
runs-on: ubuntu-26.04
2534
timeout-minutes:
2635
60
2736
container:
28-
image: buildpack-deps:noble
37+
image: buildpack-deps:resolute
2938
continue-on-error: ${{ matrix.allow-failure }}
3039
strategy:
3140
matrix:
@@ -84,19 +93,20 @@ jobs:
8493
- name: Install GHCup
8594
run: |
8695
mkdir -p "$HOME/.ghcup/bin"
87-
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
96+
curl -sL https://downloads.haskell.org/ghcup/0.2.6.2/x86_64-linux-ghcup-0.2.6.2 > "$HOME/.ghcup/bin/ghcup"
8897
chmod a+x "$HOME/.ghcup/bin/ghcup"
8998
- name: Install cabal-install
9099
run: |
91-
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
92-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
100+
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
101+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
93102
- name: Install GHC (GHCup)
94103
if: matrix.setup-method == 'ghcup'
95104
run: |
96105
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
97-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
98-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
99-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
106+
HCDIR=$("$HOME/.ghcup/bin/ghcup" whereis --directory ghc "$HCVER")
107+
HC="${HCDIR%/}/ghc"
108+
HCPKG="${HCDIR%/}/ghc-pkg"
109+
HADDOCK="${HCDIR%/}/haddock"
100110
echo "HC=$HC" >> "$GITHUB_ENV"
101111
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
102112
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
@@ -145,6 +155,7 @@ jobs:
145155
cat >> $CABAL_CONFIG <<EOF
146156
program-default-options
147157
ghc-options: $GHCJOBS +RTS -M3G -RTS
158+
hsc2hs-options: --lflag=-fuse-ld=bfd
148159
EOF
149160
cat $CABAL_CONFIG
150161
- name: versions
@@ -154,7 +165,7 @@ jobs:
154165
$CABAL --version || true
155166
- name: update cabal index
156167
run: |
157-
$CABAL v2-update -v
168+
$CABAL update -v
158169
- name: install cabal-plan
159170
run: |
160171
mkdir -p $HOME/.cabal/bin
@@ -202,7 +213,7 @@ jobs:
202213
cat cabal.project.local
203214
- name: dump install plan
204215
run: |
205-
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
216+
$CABAL build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
206217
cabal-plan
207218
- name: restore cache
208219
uses: actions/cache/restore@v6
@@ -212,28 +223,28 @@ jobs:
212223
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
213224
- name: install dependencies
214225
run: |
215-
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
216-
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
226+
$CABAL build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
227+
$CABAL build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
217228
- name: build w/o tests
218229
run: |
219-
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
230+
$CABAL build $ARG_COMPILER --disable-tests --disable-benchmarks all
220231
- name: build
221232
run: |
222-
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
233+
$CABAL build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
223234
- name: tests
224235
run: |
225-
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
236+
$CABAL test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
226237
- name: cabal check
227238
run: |
228239
cd ${PKGDIR_direct_sqlite} || false
229240
${CABAL} -vnormal check
230241
- name: haddock
231242
run: |
232-
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
243+
$CABAL haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
233244
- name: unconstrained build
234245
run: |
235246
rm -f cabal.project.local
236-
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
247+
$CABAL build $ARG_COMPILER --disable-tests --disable-benchmarks all
237248
- name: save cache
238249
if: always()
239250
uses: actions/cache/save@v6

0 commit comments

Comments
 (0)