Skip to content

Commit becffd7

Browse files
authored
Merge pull request #17 from andreasabel/ci
v1.0.1.1: require base >= 4.11, CI for GHC 8.4-9.12 (fixes #16)
2 parents c99d861 + fa35c38 commit becffd7

File tree

5 files changed

+101
-86
lines changed

5 files changed

+101
-86
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 65 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,55 @@
66
#
77
# haskell-ci regenerate
88
#
9-
# For more information, see https://github.com/haskell-CI/haskell-ci
9+
# For more information, see https://github.com/andreasabel/haskell-ci
1010
#
11-
# version: 0.17.20231010
11+
# version: 0.19.20241021
1212
#
13-
# REGENDATA ("0.17.20231010",["github","Diff.cabal"])
13+
# REGENDATA ("0.19.20241021",["github","Diff.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
17-
- push
18-
- pull_request
17+
push:
18+
branches:
19+
- master
20+
pull_request:
21+
branches:
22+
- master
1923
jobs:
2024
linux:
2125
name: Haskell-CI - Linux - ${{ matrix.compiler }}
2226
runs-on: ubuntu-20.04
2327
timeout-minutes:
2428
60
2529
container:
26-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
2731
continue-on-error: ${{ matrix.allow-failure }}
2832
strategy:
2933
matrix:
3034
include:
31-
- compiler: ghc-9.8.1
35+
- compiler: ghc-9.12.20241014
3236
compilerKind: ghc
33-
compilerVersion: 9.8.1
37+
compilerVersion: 9.12.20241014
3438
setup-method: ghcup
3539
allow-failure: false
36-
- compiler: ghc-9.6.3
40+
- compiler: ghc-9.10.1
3741
compilerKind: ghc
38-
compilerVersion: 9.6.3
42+
compilerVersion: 9.10.1
3943
setup-method: ghcup
4044
allow-failure: false
41-
- compiler: ghc-9.4.7
45+
- compiler: ghc-9.8.2
4246
compilerKind: ghc
43-
compilerVersion: 9.4.7
47+
compilerVersion: 9.8.2
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.6.6
51+
compilerKind: ghc
52+
compilerVersion: 9.6.6
53+
setup-method: ghcup
54+
allow-failure: false
55+
- compiler: ghc-9.4.8
56+
compilerKind: ghc
57+
compilerVersion: 9.4.8
4458
setup-method: ghcup
4559
allow-failure: false
4660
- compiler: ghc-9.2.8
@@ -61,54 +75,30 @@ jobs:
6175
- compiler: ghc-8.8.4
6276
compilerKind: ghc
6377
compilerVersion: 8.8.4
64-
setup-method: hvr-ppa
78+
setup-method: ghcup
6579
allow-failure: false
6680
- compiler: ghc-8.6.5
6781
compilerKind: ghc
6882
compilerVersion: 8.6.5
69-
setup-method: hvr-ppa
83+
setup-method: ghcup
7084
allow-failure: false
7185
- compiler: ghc-8.4.4
7286
compilerKind: ghc
7387
compilerVersion: 8.4.4
74-
setup-method: hvr-ppa
75-
allow-failure: false
76-
- compiler: ghc-8.2.2
77-
compilerKind: ghc
78-
compilerVersion: 8.2.2
79-
setup-method: hvr-ppa
80-
allow-failure: false
81-
- compiler: ghc-8.0.2
82-
compilerKind: ghc
83-
compilerVersion: 8.0.2
84-
setup-method: hvr-ppa
85-
allow-failure: false
86-
- compiler: ghc-7.10.3
87-
compilerKind: ghc
88-
compilerVersion: 7.10.3
89-
setup-method: hvr-ppa
88+
setup-method: ghcup
9089
allow-failure: false
9190
fail-fast: false
9291
steps:
9392
- name: apt
9493
run: |
9594
apt-get update
96-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
97-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
98-
mkdir -p "$HOME/.ghcup/bin"
99-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
100-
chmod a+x "$HOME/.ghcup/bin/ghcup"
101-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
102-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
103-
else
104-
apt-add-repository -y 'ppa:hvr/ghc'
105-
apt-get update
106-
apt-get install -y "$HCNAME"
107-
mkdir -p "$HOME/.ghcup/bin"
108-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
109-
chmod a+x "$HOME/.ghcup/bin/ghcup"
110-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
111-
fi
95+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
96+
mkdir -p "$HOME/.ghcup/bin"
97+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
98+
chmod a+x "$HOME/.ghcup/bin/ghcup"
99+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
100+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
101+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
112102
env:
113103
HCKIND: ${{ matrix.compilerKind }}
114104
HCNAME: ${{ matrix.compiler }}
@@ -120,27 +110,18 @@ jobs:
120110
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
121111
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
122112
HCDIR=/opt/$HCKIND/$HCVER
123-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
124-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
125-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
126-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
127-
echo "HC=$HC" >> "$GITHUB_ENV"
128-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
129-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
130-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
131-
else
132-
HC=$HCDIR/bin/$HCKIND
133-
echo "HC=$HC" >> "$GITHUB_ENV"
134-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
135-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
136-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
137-
fi
138-
113+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
114+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
115+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
116+
echo "HC=$HC" >> "$GITHUB_ENV"
117+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
118+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
119+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
139120
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
140121
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
141122
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
142123
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
143-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
124+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
144125
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
145126
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
146127
env:
@@ -169,6 +150,18 @@ jobs:
169150
repository hackage.haskell.org
170151
url: http://hackage.haskell.org/
171152
EOF
153+
if $HEADHACKAGE; then
154+
cat >> $CABAL_CONFIG <<EOF
155+
repository head.hackage.ghc.haskell.org
156+
url: https://ghc.gitlab.haskell.org/head.hackage/
157+
secure: True
158+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
159+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
160+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
161+
key-threshold: 3
162+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
163+
EOF
164+
fi
172165
cat >> $CABAL_CONFIG <<EOF
173166
program-default-options
174167
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -192,7 +185,7 @@ jobs:
192185
chmod a+x $HOME/.cabal/bin/cabal-plan
193186
cabal-plan --version
194187
- name: checkout
195-
uses: actions/checkout@v3
188+
uses: actions/checkout@v4
196189
with:
197190
path: source
198191
- name: initial cabal.project for sdist
@@ -216,19 +209,22 @@ jobs:
216209
touch cabal.project
217210
touch cabal.project.local
218211
echo "packages: ${PKGDIR_Diff}" >> cabal.project
219-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package Diff" >> cabal.project ; fi
220-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
212+
echo "package Diff" >> cabal.project
213+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
221214
cat >> cabal.project <<EOF
222215
EOF
223-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(Diff)$/; }' >> cabal.project.local
216+
if $HEADHACKAGE; then
217+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
218+
fi
219+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(Diff)$/; }' >> cabal.project.local
224220
cat cabal.project
225221
cat cabal.project.local
226222
- name: dump install plan
227223
run: |
228224
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
229225
cabal-plan
230226
- name: restore cache
231-
uses: actions/cache/restore@v3
227+
uses: actions/cache/restore@v4
232228
with:
233229
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
234230
path: ~/.cabal/store
@@ -258,7 +254,7 @@ jobs:
258254
rm -f cabal.project.local
259255
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
260256
- name: save cache
261-
uses: actions/cache/save@v3
257+
uses: actions/cache/save@v4
262258
if: always()
263259
with:
264260
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist-newstyle/

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.1.1
2+
3+
- Require `base >= 4.11` (GHC 8.4).
4+
15
# 1.0
26

37
- Add Unix diff style annotations to output of `prettyContextDiff`,

Diff.cabal

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Cabal-Version: 1.18
22
name: Diff
3-
version: 1.0.1
3+
version: 1.0.1.1
44
synopsis: Diff algorithm in pure Haskell
55
description: Implementation of the standard diff algorithm in Haskell.
66
.
@@ -12,16 +12,29 @@ license: BSD3
1212
license-file: LICENSE
1313
author: Sterling Clover
1414
maintainer: David Fox <dsf@seereason.com>
15-
Tested-With: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5,
16-
GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.7,
17-
GHC == 9.6.3, GHC == 9.8.1
1815
Build-Type: Simple
1916

17+
tested-with:
18+
GHC == 9.12.0
19+
GHC == 9.10.1
20+
GHC == 9.8.2
21+
GHC == 9.6.6
22+
GHC == 9.4.8
23+
GHC == 9.2.8
24+
GHC == 9.0.2
25+
GHC == 8.10.7
26+
GHC == 8.8.4
27+
GHC == 8.6.5
28+
GHC == 8.4.4
29+
2030
extra-doc-files: CHANGELOG.md
2131

2232
library
2333
default-language: Haskell2010
24-
build-depends: base >= 4.8 && <= 6, array, pretty >= 1.1
34+
build-depends:
35+
base >= 4.11 && <= 6
36+
, array
37+
, pretty >= 1.1
2538
hs-source-dirs: src
2639
exposed-modules:
2740
Data.Algorithm.Diff,
@@ -31,20 +44,20 @@ library
3144

3245
source-repository head
3346
type: git
34-
location: http://github.com/seereason/Diff
47+
location: https://github.com/seereason/Diff
3548

3649
test-suite diff-tests
3750
default-language: Haskell2010
3851
type: exitcode-stdio-1.0
39-
hs-source-dirs: test, src
52+
hs-source-dirs: test
4053
main-is: Test.hs
41-
build-depends: base >= 3 && <= 6, array
42-
, pretty, QuickCheck, test-framework
43-
, test-framework-quickcheck2, process
44-
, directory
45-
if impl(ghc < 8.0)
46-
build-depends: semigroups
47-
other-modules:
48-
Data.Algorithm.Diff,
49-
Data.Algorithm.DiffOutput
50-
Data.Algorithm.DiffContext
54+
build-depends:
55+
Diff
56+
, base >= 3 && <= 6
57+
, array
58+
, pretty
59+
, directory
60+
, process
61+
, QuickCheck
62+
, test-framework
63+
, test-framework-quickcheck2

cabal.haskell-ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
branches: master

0 commit comments

Comments
 (0)