Skip to content

Commit 1056593

Browse files
authored
Allow newer dependencies (#114)
* Allow newer dependencies * Update Haskell-CI to 0.18.1 * Update Haskell-CI to 0.19.20240702
1 parent 2c8092b commit 1056593

File tree

7 files changed

+42
-52
lines changed

7 files changed

+42
-52
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.16.6
11+
# version: 0.19.20240702
1212
#
13-
# REGENDATA ("0.16.6",["github","--config=cabal.haskell-ci","cabal.project"])
13+
# REGENDATA ("0.19.20240702",["github","--config=cabal.haskell-ci","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -27,7 +27,7 @@ jobs:
2727
timeout-minutes:
2828
60
2929
container:
30-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
3131
continue-on-error: ${{ matrix.allow-failure }}
3232
strategy:
3333
matrix:
@@ -60,29 +60,19 @@ jobs:
6060
- compiler: ghc-8.8.4
6161
compilerKind: ghc
6262
compilerVersion: 8.8.4
63-
setup-method: hvr-ppa
63+
setup-method: ghcup
6464
allow-failure: false
6565
fail-fast: false
6666
steps:
6767
- name: apt
6868
run: |
6969
apt-get update
7070
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
71-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
72-
mkdir -p "$HOME/.ghcup/bin"
73-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
74-
chmod a+x "$HOME/.ghcup/bin/ghcup"
75-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
76-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
77-
else
78-
apt-add-repository -y 'ppa:hvr/ghc'
79-
apt-get update
80-
apt-get install -y "$HCNAME"
81-
mkdir -p "$HOME/.ghcup/bin"
82-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
83-
chmod a+x "$HOME/.ghcup/bin/ghcup"
84-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
85-
fi
71+
mkdir -p "$HOME/.ghcup/bin"
72+
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
73+
chmod a+x "$HOME/.ghcup/bin/ghcup"
74+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
75+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
8676
env:
8777
HCKIND: ${{ matrix.compilerKind }}
8878
HCNAME: ${{ matrix.compiler }}
@@ -94,20 +84,13 @@ jobs:
9484
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
9585
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
9686
HCDIR=/opt/$HCKIND/$HCVER
97-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
98-
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
99-
echo "HC=$HC" >> "$GITHUB_ENV"
100-
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
101-
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
102-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
103-
else
104-
HC=$HCDIR/bin/$HCKIND
105-
echo "HC=$HC" >> "$GITHUB_ENV"
106-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
107-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
108-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
109-
fi
110-
87+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
88+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
89+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
90+
echo "HC=$HC" >> "$GITHUB_ENV"
91+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
92+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
93+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
11194
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
11295
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
11396
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
@@ -164,7 +147,7 @@ jobs:
164147
chmod a+x $HOME/.cabal/bin/cabal-plan
165148
cabal-plan --version
166149
- name: checkout
167-
uses: actions/checkout@v3
150+
uses: actions/checkout@v4
168151
with:
169152
path: source
170153
- name: initial cabal.project for sdist
@@ -216,15 +199,15 @@ jobs:
216199
echo " ghc-options: -Werror=missing-methods" >> cabal.project
217200
cat >> cabal.project <<EOF
218201
EOF
219-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(servant-swagger-ui|servant-swagger-ui-core|servant-swagger-ui-example|servant-swagger-ui-jensoleg|servant-swagger-ui-redoc)$/; }' >> cabal.project.local
202+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(servant-swagger-ui|servant-swagger-ui-core|servant-swagger-ui-example|servant-swagger-ui-jensoleg|servant-swagger-ui-redoc)$/; }' >> cabal.project.local
220203
cat cabal.project
221204
cat cabal.project.local
222205
- name: dump install plan
223206
run: |
224207
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
225208
cabal-plan
226209
- name: restore cache
227-
uses: actions/cache/restore@v3
210+
uses: actions/cache/restore@v4
228211
with:
229212
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
230213
path: ~/.cabal/store
@@ -292,7 +275,7 @@ jobs:
292275
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.16.*' --dependencies-only -j2 all ; fi
293276
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.16.*' all ; fi
294277
- name: save cache
295-
uses: actions/cache/save@v3
278+
uses: actions/cache/save@v4
296279
if: always()
297280
with:
298281
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

cabal.project

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ packages:
44
servant-swagger-ui-example/
55
servant-swagger-ui-jensoleg/
66
servant-swagger-ui-redoc/
7+
8+
if impl(ghc >= 9.8) && impl(ghc < 9.10)
9+
-- https://github.com/GetShopTV/swagger2/pull/255
10+
allow-newer: swagger2:Cabal
11+
allow-newer: swagger2:base-compat-batteries
12+
allow-newer: swagger2:lens
13+
allow-newer: swagger2:network

servant-swagger-ui-core/servant-swagger-ui-core.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ library
3636
hs-source-dirs: src
3737
ghc-options: -Wall
3838
build-depends:
39-
base >=4.7 && <4.19
39+
base >=4.7 && <4.21
4040
, aeson >=0.8.0.2 && <2.3
4141
, blaze-markup >=0.7.0.2 && <0.9
42-
, bytestring >=0.10.4.0 && <0.12
42+
, bytestring >=0.10.4.0 && <0.13
4343
, http-media >=0.7.1.3 && <0.9
4444
, servant >=0.14 && <0.21
4545
, servant-blaze >=0.8 && <0.10
4646
, servant-server >=0.14 && <0.21
47-
, text >=1.2.3.0 && <2.1
47+
, text >=1.2.3.0 && <2.2
4848
, transformers >=0.3 && <0.7
4949
, transformers-compat >=0.3 && <0.8
5050
, wai-app-static >=3.0.1.1 && <3.2

servant-swagger-ui-example/servant-swagger-ui-example.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ executable servant-swagger-ui-example
3030
ghc-options: -threaded
3131
build-depends:
3232
aeson >=0.8.0.2 && <2.3
33-
, base >=4.7 && <4.19
34-
, base-compat >=0.9.3 && <0.14
35-
, lens >=4.7.0.1 && <5.3
33+
, base >=4.7 && <4.21
34+
, base-compat >=0.9.3 && <0.15
35+
, lens >=4.7.0.1 && <5.4
3636
, servant
3737
, servant-server
3838
, servant-swagger

servant-swagger-ui-jensoleg/servant-swagger-ui-jensoleg.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ library
8585
ghc-options: -Wall
8686
build-depends: servant-swagger-ui-core >=0.3.5 && <0.4
8787
build-depends:
88-
base >=4.7 && <4.19
88+
base >=4.7 && <4.21
8989
, aeson >=0.8.0.2 && <2.3
90-
, bytestring >=0.10.4.0 && <0.12
90+
, bytestring >=0.10.4.0 && <0.13
9191
, file-embed-lzma >=0 && <0.1
9292
, servant >=0.14 && <0.21
9393
, servant-server >=0.14 && <0.21
94-
, text >=1.2.3.0 && <2.1
94+
, text >=1.2.3.0 && <2.2
9595

9696
exposed-modules: Servant.Swagger.UI.JensOleG
9797
default-language: Haskell2010

servant-swagger-ui-redoc/servant-swagger-ui-redoc.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ library
3939
ghc-options: -Wall
4040
build-depends: servant-swagger-ui-core >=0.3.5 && <0.4
4141
build-depends:
42-
base >=4.7 && <4.19
42+
base >=4.7 && <4.21
4343
, aeson >=0.8.0.2 && <2.3
44-
, bytestring >=0.10.4.0 && <0.12
44+
, bytestring >=0.10.4.0 && <0.13
4545
, file-embed-lzma >=0 && <0.1
4646
, servant >=0.14 && <0.21
4747
, servant-server >=0.14 && <0.21
48-
, text >=1.2.3.0 && <2.1
48+
, text >=1.2.3.0 && <2.2
4949

5050
exposed-modules: Servant.Swagger.UI.ReDoc
5151
default-language: Haskell2010

servant-swagger-ui/servant-swagger-ui.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ library
5555
ghc-options: -Wall
5656
build-depends: servant-swagger-ui-core >=0.3.5 && <0.4
5757
build-depends:
58-
base >=4.7 && <4.19
58+
base >=4.7 && <4.21
5959
, aeson >=0.8.0.2 && <2.3
60-
, bytestring >=0.10.4.0 && <0.12
60+
, bytestring >=0.10.4.0 && <0.13
6161
, file-embed-lzma >=0 && <0.1
6262
, servant >=0.14 && <0.21
6363
, servant-server >=0.14 && <0.21
64-
, text >=1.2.3.0 && <2.1
64+
, text >=1.2.3.0 && <2.2
6565

6666
exposed-modules: Servant.Swagger.UI
6767
default-language: Haskell2010

0 commit comments

Comments
 (0)