Skip to content

Commit b711d34

Browse files
committed
Support GHC 9.14, update CI
1 parent 2261314 commit b711d34

4 files changed

Lines changed: 268 additions & 66 deletions

File tree

.github/workflows/ci.yml

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

.github/workflows/haskell-ci.yml

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

shell.nix

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

shower.cabal

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1+
cabal-version: 2.4
12
name: shower
2-
version: 0.2.0.4
3+
version: 0.2.0.5
34
synopsis: Clean up the formatting of 'show' output
45
-- description:
5-
license: BSD3
6+
license: BSD-3-Clause
67
license-file: LICENSE
78
author: Vladislav Zavialov
89
maintainer: Monadfix <hi@monadfix.com>
910
category: Development
1011
build-type: Simple
11-
cabal-version: >=1.10
12+
tested-with: GHC ==8.4.4, GHC ==8.6.5, GHC ==8.8.4, GHC ==8.10.7, GHC ==9.0.2,
13+
GHC ==9.2.8, GHC ==9.4.8, GHC ==9.6.7, GHC ==9.8.4, GHC ==9.10.3,
14+
GHC ==9.12.4, GHC ==9.14.1
1215

1316
homepage: https://monadfix.com/shower
14-
bug-reports: http://github.com/monadfix/shower/issues
17+
bug-reports: https://github.com/monadfix/shower/issues
1518

1619
extra-source-files:
1720
tests/in-out/*.in
1821
tests/in-out/*.out
1922

2023
source-repository head
2124
type: git
22-
location: git://github.com/monadfix/shower.git
25+
location: git@github.com:monadfix/shower.git
2326

2427
library
2528
exposed-modules:
@@ -29,9 +32,9 @@ library
2932
Shower.Parser
3033
Shower.Class
3134
build-depends:
32-
base >=4.10 && <4.22,
33-
megaparsec,
34-
pretty
35+
base >=4.10 && <4.23,
36+
megaparsec <9.8,
37+
pretty <1.2
3538
hs-source-dirs: lib
3639
default-language: Haskell2010
3740
ghc-options: -Wall -O2
@@ -58,7 +61,6 @@ test-suite shower-tests
5861
tasty-quickcheck,
5962
QuickCheck,
6063
containers,
61-
unordered-containers,
6264
vector,
6365
text,
6466
filepath,

0 commit comments

Comments
 (0)