Skip to content

Commit fce9088

Browse files
committed
Haskell-CI: bump to GHC 9.6.1 and 9.2.7
- cabal.haskell-ci: do not insist on installed Cabal-syntax
1 parent 649896f commit fce9088

File tree

3 files changed

+225
-2
lines changed

3 files changed

+225
-2
lines changed

.github/workflows/haskell-ci.yml

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

cabal.haskell-ci

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
branches: master ci*
22

3-
installed: +all -Cabal -text -parsec -process
3+
installed: +all -Cabal -Cabal-syntax -text -parsec -process
44

55
-- Does not work with GHA:
66
-- -- allow failures with ghc-7.6 and ghc-7.8
@@ -10,6 +10,7 @@ installed: +all -Cabal -text -parsec -process
1010
distribution: jammy
1111

1212
apt: libbrotli-dev libgd-dev
13+
-- libgd-dev is for gd via hs-captcha
1314

1415
-- Make sure the haddock step is included,
1516
-- even though we don't define any library.

hackage-server.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ copyright: 2008-2015 Duncan Coutts,
2727
license: BSD-3-Clause
2828
license-file: LICENSE
2929

30-
tested-with: GHC == { 9.4.4, 9.2.6, 9.0.2, 8.10.7, 8.8.4 }
30+
tested-with: GHC == { 9.6.1, 9.4.4, 9.2.7, 9.0.2, 8.10.7, 8.8.4 }
3131

3232
data-dir: datafiles
3333
data-files:

0 commit comments

Comments
 (0)