Skip to content

Commit c1700b0

Browse files
Support GHC 9.6 through 9.14
1 parent 83986bd commit c1700b0

File tree

3 files changed

+109
-51
lines changed

3 files changed

+109
-51
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 96 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,104 @@
11
# This GitHub workflow config has been generated by a script via
22
#
3-
# haskell-ci 'github' 'one-liner.cabal'
3+
# haskell-ci 'github' 'cabal.project'
44
#
55
# To regenerate the script (for example after adjusting tested-with) run
66
#
77
# haskell-ci regenerate
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.11.20210222
11+
# version: 0.19.20260104
1212
#
13-
# REGENDATA ("0.11.20210222",["github","one-liner.cabal"])
13+
# REGENDATA ("0.19.20260104",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
1717
- push
1818
- pull_request
19+
- merge_group
1920
jobs:
2021
linux:
21-
name: Haskell-CI - Linux - GHC ${{ matrix.ghc }}
22-
runs-on: ubuntu-18.04
22+
name: Haskell-CI - Linux - ${{ matrix.compiler }}
23+
runs-on: ubuntu-24.04
24+
timeout-minutes:
25+
60
2326
container:
24-
image: buildpack-deps:bionic
27+
image: buildpack-deps:jammy
2528
continue-on-error: ${{ matrix.allow-failure }}
2629
strategy:
2730
matrix:
2831
include:
29-
- ghc: 9.0.1
32+
- compiler: ghc-9.14.1
33+
compilerKind: ghc
34+
compilerVersion: 9.14.1
35+
setup-method: ghcup
36+
allow-failure: false
37+
- compiler: ghc-9.12.2
38+
compilerKind: ghc
39+
compilerVersion: 9.12.2
40+
setup-method: ghcup
41+
allow-failure: false
42+
- compiler: ghc-9.10.3
43+
compilerKind: ghc
44+
compilerVersion: 9.10.3
45+
setup-method: ghcup
46+
allow-failure: false
47+
- compiler: ghc-9.8.4
48+
compilerKind: ghc
49+
compilerVersion: 9.8.4
50+
setup-method: ghcup
51+
allow-failure: false
52+
- compiler: ghc-9.6.7
53+
compilerKind: ghc
54+
compilerVersion: 9.6.7
55+
setup-method: ghcup
3056
allow-failure: false
3157
fail-fast: false
3258
steps:
33-
- name: apt
59+
- name: apt-get install
3460
run: |
3561
apt-get update
36-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
37-
apt-add-repository -y 'ppa:hvr/ghc'
38-
apt-get update
39-
apt-get install -y ghc-$GHC_VERSION cabal-install-3.4
62+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
63+
- name: Install GHCup
64+
run: |
65+
mkdir -p "$HOME/.ghcup/bin"
66+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
67+
chmod a+x "$HOME/.ghcup/bin/ghcup"
68+
- name: Install cabal-install
69+
run: |
70+
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
71+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
72+
- name: Install GHC (GHCup)
73+
if: matrix.setup-method == 'ghcup'
74+
run: |
75+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
76+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
77+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
78+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
79+
echo "HC=$HC" >> "$GITHUB_ENV"
80+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
81+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
4082
env:
41-
GHC_VERSION: ${{ matrix.ghc }}
83+
HCKIND: ${{ matrix.compilerKind }}
84+
HCNAME: ${{ matrix.compiler }}
85+
HCVER: ${{ matrix.compilerVersion }}
4286
- name: Set PATH and environment variables
4387
run: |
4488
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
45-
echo "LANG=C.UTF-8" >> $GITHUB_ENV
46-
echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
47-
echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
48-
HC=/opt/ghc/$GHC_VERSION/bin/ghc
49-
echo "HC=$HC" >> $GITHUB_ENV
50-
echo "HCPKG=/opt/ghc/$GHC_VERSION/bin/ghc-pkg" >> $GITHUB_ENV
51-
echo "HADDOCK=/opt/ghc/$GHC_VERSION/bin/haddock" >> $GITHUB_ENV
52-
echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
89+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
90+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
91+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
5392
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
54-
echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
55-
echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
56-
echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV
57-
echo "HEADHACKAGE=false" >> $GITHUB_ENV
58-
echo "ARG_COMPILER=--ghc --with-compiler=$HC" >> $GITHUB_ENV
59-
echo "GHCJSARITH=0" >> $GITHUB_ENV
93+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
94+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
95+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
96+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
97+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
6098
env:
61-
GHC_VERSION: ${{ matrix.ghc }}
99+
HCKIND: ${{ matrix.compilerKind }}
100+
HCNAME: ${{ matrix.compiler }}
101+
HCVER: ${{ matrix.compilerVersion }}
62102
- name: env
63103
run: |
64104
env
@@ -81,6 +121,10 @@ jobs:
81121
repository hackage.haskell.org
82122
url: http://hackage.haskell.org/
83123
EOF
124+
cat >> $CABAL_CONFIG <<EOF
125+
program-default-options
126+
ghc-options: $GHCJOBS +RTS -M3G -RTS
127+
EOF
84128
cat $CABAL_CONFIG
85129
- name: versions
86130
run: |
@@ -93,14 +137,14 @@ jobs:
93137
- name: install cabal-plan
94138
run: |
95139
mkdir -p $HOME/.cabal/bin
96-
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
97-
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
140+
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
141+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
98142
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
99143
rm -f cabal-plan.xz
100144
chmod a+x $HOME/.cabal/bin/cabal-plan
101145
cabal-plan --version
102146
- name: checkout
103-
uses: actions/checkout@v2
147+
uses: actions/checkout@v5
104148
with:
105149
path: source
106150
- name: initial cabal.project for sdist
@@ -119,27 +163,34 @@ jobs:
119163
- name: generate cabal.project
120164
run: |
121165
PKGDIR_one_liner="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/one-liner-[0-9.]*')"
122-
echo "PKGDIR_one_liner=${PKGDIR_one_liner}" >> $GITHUB_ENV
166+
echo "PKGDIR_one_liner=${PKGDIR_one_liner}" >> "$GITHUB_ENV"
167+
rm -f cabal.project cabal.project.local
123168
touch cabal.project
124169
touch cabal.project.local
125170
echo "packages: ${PKGDIR_one_liner}" >> cabal.project
126171
echo "package one-liner" >> cabal.project
127-
echo " ghc-options: -Werror=missing-methods" >> cabal.project
172+
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
173+
echo "package one-liner" >> cabal.project
174+
echo " ghc-options: -Werror=unused-packages" >> cabal.project
175+
echo "package one-liner" >> cabal.project
176+
echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project
128177
cat >> cabal.project <<EOF
178+
allow-newer: indexed-traversable:*
179+
allow-newer: linear-generics:*
129180
EOF
130-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(one-liner)$/; }' >> cabal.project.local
181+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(one-liner)$/; }' >> cabal.project.local
131182
cat cabal.project
132183
cat cabal.project.local
133184
- name: dump install plan
134185
run: |
135186
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
136187
cabal-plan
137-
- name: cache
138-
uses: actions/cache@v2
188+
- name: restore cache
189+
uses: actions/cache/restore@v4
139190
with:
140-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
191+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
141192
path: ~/.cabal/store
142-
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
193+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
143194
- name: install dependencies
144195
run: |
145196
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
@@ -159,8 +210,14 @@ jobs:
159210
${CABAL} -vnormal check
160211
- name: haddock
161212
run: |
162-
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
213+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
163214
- name: unconstrained build
164215
run: |
165216
rm -f cabal.project.local
166217
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
218+
- name: save cache
219+
if: always()
220+
uses: actions/cache/save@v4
221+
with:
222+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
223+
path: ~/.cabal/store

cabal.project

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
packages: *.cabal
1+
packages: .
22

3-
package one-liner
4-
ghc-options: -Wall -Werror
3+
allow-newer:
4+
, indexed-traversable:*
5+
, linear-generics:*

one-liner.cabal

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.0
22
name: one-liner
3-
version: 2.1
3+
version: 2.1.1
44
synopsis: Constraint-based generics
55
description: Write short and concise generic instances of type classes.
66
one-liner is particularly useful for writing default
@@ -13,15 +13,17 @@ author: Sjoerd Visscher, Xia Li-yao
1313
maintainer: sjoerd@w3future.com
1414
category: Generics
1515
build-type: Simple
16-
tested-with: GHC==9.0.1, GHC==9.2.1
16+
tested-with: GHC==9.6.7, GHC==9.8.4, GHC==9.10.3, GHC==9.12.2, GHC==9.14.1
1717

1818
extra-source-files:
1919
examples/*.hs
20+
extra-doc-files:
2021
CHANGELOG
2122

2223
library
2324
hs-source-dirs: src
2425
default-language: Haskell2010
26+
ghc-options: -Wall
2527

2628
exposed-modules:
2729
Generics.OneLiner
@@ -32,17 +34,16 @@ library
3234

3335
build-depends:
3436
base >= 4.9 && < 5
35-
, transformers >= 0.5 && < 0.7
3637
, contravariant >= 1.4 && < 1.6
37-
, ghc-prim >= 0.5 && < 1.0
38-
, bifunctors >= 5.4 && < 6.0
39-
, profunctors >= 5.2 && < 6.0
38+
, ghc-prim >= 0.5 && < 1
39+
, bifunctors >= 5.4 && < 6
40+
, profunctors >= 5.2 && < 6
4041
, tagged >= 0.8 && < 0.9
41-
, linear-base >= 0.1 && < 1.0
42+
, linear-base >= 0.1 && < 1
4243

4344
source-repository head
4445
type: git
45-
location: git://github.com/sjoerdvisscher/one-liner.git
46+
location: https://github.com/sjoerdvisscher/one-liner
4647

4748
test-suite unittests
4849
hs-source-dirs: test
@@ -51,7 +52,6 @@ test-suite unittests
5152

5253
build-depends:
5354
base
54-
, contravariant
5555
, HUnit
5656
, one-liner
5757

0 commit comments

Comments
 (0)