Skip to content

Commit a1fd549

Browse files
authored
Merge pull request #69 from marinelli/servant-0.20
Support servant-0.20 and add ghc-9.4 in CI
2 parents ffeefec + 36a229e commit a1fd549

File tree

6 files changed

+49
-23
lines changed

6 files changed

+49
-23
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 28 additions & 9 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
11+
# version: 0.17.20230826
1212
#
13-
# REGENDATA ("0.16",["github","cabal.project","--allow-failures",">= 9.2","--distribution","focal"])
13+
# REGENDATA ("0.17.20230826",["github","cabal.project","--allow-failures",">= 9.2","--distribution","focal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -32,9 +32,14 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.2.7
35+
- compiler: ghc-9.4.7
3636
compilerKind: ghc
37-
compilerVersion: 9.2.7
37+
compilerVersion: 9.4.7
38+
setup-method: ghcup
39+
allow-failure: true
40+
- compiler: ghc-9.2.8
41+
compilerKind: ghc
42+
compilerVersion: 9.2.8
3843
setup-method: ghcup
3944
allow-failure: true
4045
- compiler: ghc-9.0.2
@@ -65,7 +70,7 @@ jobs:
6570
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
6671
if [ "${{ matrix.setup-method }}" = ghcup ]; then
6772
mkdir -p "$HOME/.ghcup/bin"
68-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
73+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
6974
chmod a+x "$HOME/.ghcup/bin/ghcup"
7075
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
7176
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
@@ -74,7 +79,7 @@ jobs:
7479
apt-get update
7580
apt-get install -y "$HCNAME"
7681
mkdir -p "$HOME/.ghcup/bin"
77-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
82+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
7883
chmod a+x "$HOME/.ghcup/bin/ghcup"
7984
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
8085
fi
@@ -90,10 +95,12 @@ jobs:
9095
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
9196
HCDIR=/opt/$HCKIND/$HCVER
9297
if [ "${{ matrix.setup-method }}" = ghcup ]; then
93-
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
98+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
99+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
100+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
94101
echo "HC=$HC" >> "$GITHUB_ENV"
95-
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
96-
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
102+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
103+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
97104
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
98105
else
99106
HC=$HCDIR/bin/$HCKIND
@@ -243,16 +250,28 @@ jobs:
243250
- name: prepare for constraint sets
244251
run: |
245252
rm -f cabal.project.local
253+
- name: constraint set servant-0.20
254+
run: |
255+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.20.*' all --dry-run
256+
cabal-plan topo | sort
257+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.20.*' --dependencies-only -j2 all
258+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.20.*' all
246259
- name: constraint set servant-0.19
247260
run: |
261+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.19.*' all --dry-run
262+
cabal-plan topo | sort
248263
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.19.*' --dependencies-only -j2 all
249264
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.19.*' all
250265
- name: constraint set servant-0.18
251266
run: |
267+
if [ $((HCNUMVER < 90200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.18.*' all --dry-run ; fi
268+
if [ $((HCNUMVER < 90200)) -ne 0 ] ; then cabal-plan topo | sort ; fi
252269
if [ $((HCNUMVER < 90200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.18.*' --dependencies-only -j2 all ; fi
253270
if [ $((HCNUMVER < 90200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.18.*' all ; fi
254271
- name: constraint set servant-0.17
255272
run: |
273+
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.17.*' all --dry-run ; fi
274+
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then cabal-plan topo | sort ; fi
256275
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.17.*' --dependencies-only -j2 all ; fi
257276
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.17.*' all ; fi
258277
- name: save cache

cabal.haskell-ci

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ constraint-set servant-0.18
99
constraints: servant ==0.18.*
1010

1111
constraint-set servant-0.19
12-
ghc: >= 8.0 && <9.4
12+
ghc: >= 8.6 && <9.6
1313
constraints: servant ==0.19.*
14+
15+
constraint-set servant-0.20
16+
ghc: >= 8.6 && <9.8
17+
constraints: servant ==0.20.*

servant-multipart-api/servant-multipart-api.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ tested-with:
2020
|| ==8.8.4
2121
|| ==8.10.7
2222
|| ==9.0.2
23-
|| ==9.2.7
23+
|| ==9.2.8
24+
|| ==9.4.7
2425

2526
library
2627
default-language: Haskell2010
@@ -36,7 +37,7 @@ library
3637

3738
-- other dependencies
3839
build-depends:
39-
servant >=0.16 && <0.20
40+
servant >=0.16 && <0.21
4041

4142
-- servant-0.19 dropped support for GHC-8.4 (latest GHCJS version),
4243
-- due to QuantifiedConstraints

servant-multipart-client/servant-multipart-client.cabal

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ tested-with:
1919
|| ==8.8.4
2020
|| ==8.10.7
2121
|| ==9.0.2
22-
|| ==9.2.7
22+
|| ==9.2.8
23+
|| ==9.4.7
2324

2425
library
2526
default-language: Haskell2010
@@ -38,8 +39,8 @@ library
3839
build-depends:
3940
servant-multipart-api == 0.12.*
4041
, http-media >=0.7.1.3 && <0.9
41-
, servant >=0.16 && <0.20
42-
, servant-client-core >=0.16 && <0.20
42+
, servant >=0.16 && <0.21
43+
, servant-client-core >=0.16 && <0.21
4344

4445
-- servant-0.19 dropped support for GHC-8.4 (latest GHCJS version),
4546
-- due to QuantifiedConstraints

servant-multipart-client/src/Servant/Multipart/Client.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ instance MultipartClient Tmp where
7474
readHandle hdl = fromActionStep LBS.null (LBS.hGet hdl 4096)
7575

7676
instance MultipartClient Mem where
77-
loadFile _ = source . pure
77+
loadFile _ = source . pure @[]
7878

7979
-- | Generates a boundary to be used to separate parts of the multipart.
8080
-- Requires 'IO' because it is randomized.
@@ -132,7 +132,7 @@ multipartToBody boundary mp = RequestBodySource $ files' <> source ["--", bounda
132132
renderInput input = renderPart (lencode . iName $ input)
133133
"text/plain"
134134
""
135-
(source . pure . lencode . iValue $ input)
135+
(source . pure @[] . lencode . iValue $ input)
136136
inputs' = foldl' (\acc x -> acc `mappend'` renderInput x) mempty' (inputs mp)
137137
renderFile :: FileData tag -> SourceIO LBS.ByteString
138138
renderFile file = renderPart (lencode . fdInputName $ file)

servant-multipart/servant-multipart.cabal

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ tested-with:
1919
|| ==8.8.4
2020
|| ==8.10.7
2121
|| ==9.0.2
22-
|| ==9.2.7
22+
|| ==9.2.8
23+
|| ==9.4.7
2324

2425
library
2526
default-language: Haskell2010
@@ -37,11 +38,11 @@ library
3738
build-depends:
3839
servant-multipart-api == 0.12.*
3940
, lens >=4.17 && <5.3
40-
, resourcet >=1.2.2 && <1.3
41-
, servant >=0.16 && <0.20
42-
, servant-docs >=0.10 && <0.20
43-
, servant-foreign >=0.15 && <0.20
44-
, servant-server >=0.16 && <0.20
41+
, resourcet >=1.2.2 && <1.4
42+
, servant >=0.16 && <0.21
43+
, servant-docs >=0.10 && <0.14
44+
, servant-foreign >=0.15 && <0.17
45+
, servant-server >=0.16 && <0.21
4546
, string-conversions >=0.4.0.1 && <0.5
4647
, wai >=3.2.1.2 && <3.3
4748
, wai-extra >=3.0.24.3 && <3.2

0 commit comments

Comments
 (0)