Skip to content

Commit 825415f

Browse files
committed
Allow newer filepath and data-default-class; github CI for GHC 8.0-9.12
1 parent e91efeb commit 825415f

File tree

3 files changed

+281
-50
lines changed

3 files changed

+281
-50
lines changed

.github/workflows/haskell-ci.yml

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

.travis.yml

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

lock-file.cabal

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
cabal-version: >=1.10
12
name: lock-file
23
version: 0.7.1.0
4+
x-revision: 1
35
synopsis: Provide exclusive access to a resource using lock file.
46
description:
57
Provide exclusive access to a resource using lock file, which are files whose
@@ -16,7 +18,22 @@ maintainer: peter.trsko@gmail.com
1618
copyright: (c) 2013-2016, 2018 Peter Trško
1719
category: System
1820
build-type: Simple
19-
cabal-version: >=1.10
21+
22+
tested-with:
23+
GHC == 9.12.2
24+
GHC == 9.10.1
25+
GHC == 9.8.4
26+
GHC == 9.6.7
27+
GHC == 9.4.8
28+
GHC == 9.2.8
29+
GHC == 9.0.2
30+
GHC == 8.10.7
31+
GHC == 8.8.4
32+
GHC == 8.6.5
33+
GHC == 8.4.4
34+
GHC == 8.2.2
35+
GHC == 8.0.2
36+
2037

2138
extra-source-files:
2239
ChangeLog.md
@@ -41,7 +58,7 @@ library
4158

4259
build-depends:
4360
base >=4.9 && <5
44-
, data-default-class >=0.0 && <0.2
61+
, data-default-class >=0.0 && <0.3
4562
, directory >=1.1 && <1.4
4663
, exceptions >0.6 && <0.11
4764

@@ -85,13 +102,13 @@ test-suite lock-file-unit-tests
85102
build-depends:
86103
-- {{{ Dependencies of lock-file library ----------------------------------
87104
base >=4.5 && <5
88-
, data-default-class >=0.0 && <0.2
105+
, data-default-class >=0.0 && <0.3
89106
, directory >=1.1 && <1.4
90107
, exceptions >0.6 && <0.11
91108
-- }}} Dependencies of lock-file library ----------------------------------
92109

93110
-- {{{ Test-suite dependencies --------------------------------------------
94-
, filepath ==1.3.* || ==1.4.*
111+
, filepath >= 1.3 && < 1.6
95112
, HUnit >=1.2 && <2
96113
-- ^ Same constraints as test-framework-hunit
97114
, test-framework >=0.8 && <1
@@ -149,7 +166,7 @@ executable lock-file-example
149166

150167
build-depends:
151168
base >=4.5 && <5
152-
, data-default-class >=0.0 && <0.2
169+
, data-default-class >=0.0 && <0.3
153170

154171
, lock-file
155172

@@ -177,7 +194,7 @@ executable lock-file-example-pid-file
177194

178195
build-depends:
179196
base >=4.5 && <5
180-
, data-default-class >=0.0 && <0.2
197+
, data-default-class >=0.0 && <0.3
181198
, unix ==2.*
182199

183200
, lock-file
@@ -196,9 +213,9 @@ executable lock-file-example-pid-file
196213

197214
source-repository head
198215
type: git
199-
location: git://github.com/trskop/lock-file.git
216+
location: https://github.com/trskop/lock-file.git
200217

201218
--source-repository this
202219
-- type: git
203-
-- location: git://github.com/trskop/lock-file.git
220+
-- location: https://github.com/trskop/lock-file.git
204221
-- tag: 0.7.1.0

0 commit comments

Comments
 (0)