Skip to content

Commit cfd97ef

Browse files
authored
Merge pull request haskell-servant/servant-quickcheck#87 from MangoIV/mangoiv/newser-servant-base-ghc
[feat] fix build with recent servant versions
2 parents 3c8718b + 87528bb commit cfd97ef

File tree

15 files changed

+484
-147
lines changed

15 files changed

+484
-147
lines changed

servant-quickcheck/.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake . -Lv
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: haskell ci
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
jobs:
7+
generate-matrix:
8+
name: "Generate matrix from cabal"
9+
outputs:
10+
matrix: ${{ steps.set-matrix.outputs.matrix }}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Extract the tested GHC versions
14+
id: set-matrix
15+
uses: kleidukos/[email protected]
16+
with:
17+
cabal-file: servant-quickcheck.cabal
18+
ubuntu-version: latest
19+
macos-version: latest
20+
windows-version: latest
21+
version: 0.1.7.0
22+
tests:
23+
name: ${{ matrix.ghc }} on ${{ matrix.os }}
24+
needs: generate-matrix
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: haskell-actions/setup@v2
31+
id: setup-haskell
32+
with:
33+
ghc-version: ${{ matrix.ghc }}
34+
- name: Cache
35+
uses: actions/[email protected]
36+
with:
37+
path: ${{ steps.setup-haskell.outputs.cabal-store }}
38+
key: ${{ matrix.os }}-ghc-${{ matrix.ghc }}-cabal-${{ hashFiles('**/plan.json') }}
39+
restore-keys: ${{ matrix.os }}-ghc-${{ matrix.ghc }}-
40+
- run: cabal test all
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: nix ci
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
jobs:
7+
build:
8+
permissions:
9+
contents: read
10+
id-token: write
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: DeterminateSystems/nix-installer-action@main
15+
- uses: DeterminateSystems/magic-nix-cache-action@main
16+
- run: nix -L flake check
17+
- run: nix -L build .#servant-quickcheck
18+
- run: nix -L build .#ghc94-servant-quickcheck
19+
- run: nix -L build .#ghc98-servant-quickcheck

servant-quickcheck/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ samples/
44
test-servers/
55
/doc/
66
.stack-work/
7+
.pre-commit-config.yaml
8+
.direnv
9+
dist*
10+
result*

servant-quickcheck/CHANGELOG.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
releases:
2+
- version: "0.1.0.0"
3+
changes:
4+
- description: "Support servant{-server,-client} up to 0.20, support base up to 4.19, drop support for some older servant and base versions, drop support for stack, drop testing for some older ghc versions"
5+
authors: mangoiv
6+
date: 2024-04-02
27
- version: "0.0.9.0"
38
changes:
49
- description: "Support servant-0.15 (#65)"

servant-quickcheck/cabal.haskell-ci

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

servant-quickcheck/cabal.project

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
packages: .
1+
packages:
2+
./.
3+
4+
-- due to a bug in the nixpkgs haskell infrastructure (or cabal, if you will)
5+
-- it is impossible to provided hspec-discover in a devShell therefore having
6+
-- to resort to downloads from hackage
7+
repository hackage.haskell.org
8+
url: http://hackage.haskell.org/
9+
210
tests: true
311

412
allow-newer: servant-blaze:servant
13+
14+
test-show-details: direct

servant-quickcheck/doc/doc.cabal

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: doc
2-
version: 0.1.0.0
3-
license: BSD3
4-
license-file: LICENSE
5-
author: Julian K. Arni
6-
maintainer: [email protected]
7-
build-type: Simple
8-
cabal-version: >=1.10
1+
name: doc
2+
version: 0.1.0.0
3+
license: BSD3
4+
license-file: LICENSE
5+
author: Julian K. Arni
6+
maintainer: [email protected]
7+
build-type: Simple
8+
cabal-version: >=1.10
99

1010
-- library
1111
-- exposed-modules: ServersEqual
@@ -39,19 +39,21 @@ cabal-version: >=1.10
3939
-- ghc-options: -Wall -Werror -pgmL markdown-unlit
4040

4141
executable announcement
42-
main-is: Announcement.lhs
43-
build-depends: base >=4.8 && <4.9
44-
, servant-server == 0.7.*
45-
, servant-quickcheck
46-
, servant-client
47-
, QuickCheck
48-
, stm
49-
, containers
50-
, transformers
51-
, warp
52-
, aeson
53-
, hspec
54-
, postgresql-simple
55-
, text
56-
default-language: Haskell2010
57-
ghc-options: -Wall
42+
main-is: Announcement.lhs
43+
build-depends:
44+
aeson
45+
, base >=4.8 && <4.9
46+
, containers
47+
, hspec
48+
, postgresql-simple
49+
, QuickCheck
50+
, servant-client
51+
, servant-quickcheck
52+
, servant-server >=0.7 && <0.8
53+
, stm
54+
, text
55+
, transformers
56+
, warp
57+
58+
default-language: Haskell2010
59+
ghc-options: -Wall
Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
1-
-- Initial posts.cabal generated by cabal init. For further documentation,
2-
-- see http://haskell.org/cabal/users-guide/
1+
name: posts
2+
version: 0.1.0.0
33

4-
name: posts
5-
version: 0.1.0.0
64
-- synopsis:
75
-- description:
8-
license: BSD3
9-
license-file: LICENSE
10-
author: Julian K. Arni
11-
maintainer: [email protected]
6+
license: BSD3
7+
license-file: LICENSE
8+
author: Julian K. Arni
9+
maintainer: [email protected]
10+
1211
-- copyright:
1312
-- category:
14-
build-type: Simple
13+
build-type: Simple
14+
1515
-- extra-source-files:
16-
cabal-version: >=1.10
16+
cabal-version: >=1.10
1717

1818
executable posts
19-
main-is: Main.hs
20-
build-depends: base >=4.8 && <4.9
21-
, servant-server >=0.5 && <0.8
22-
, aeson >=0.9 && <0.12
23-
, text == 1.*
24-
, warp >=3.0 && <3.3
25-
, transformers >=0.4 && <0.5
26-
, postgresql-simple
27-
hs-source-dirs: src
28-
ghc-options: -Wall -O2 -threaded
29-
default-language: Haskell2010
19+
main-is: Main.hs
20+
build-depends:
21+
aeson >=0.9 && <0.12
22+
, base >=4.8 && <4.9
23+
, postgresql-simple
24+
, servant-server >=0.5 && <0.8
25+
, text >=1 && <2
26+
, transformers >=0.4 && <0.5
27+
, warp >=3.0 && <3.3
28+
29+
hs-source-dirs: src
30+
ghc-options: -Wall -O2 -threaded
31+
default-language: Haskell2010
3032

3133
test-suite spec
32-
type: exitcode-stdio-1.0
33-
ghc-options: -Wall -O2 -threaded
34-
default-language: Haskell2010
35-
hs-source-dirs: src
36-
main-is: Spec.hs
37-
build-depends: base == 4.*
38-
, servant-quickcheck
39-
, hspec == 2.*
40-
, servant-server >=0.5 && <0.8
41-
, aeson >=0.9 && <0.12
42-
, text == 1.*
43-
, warp >=3.0 && <3.3
44-
, transformers >=0.4 && <0.5
45-
, postgresql-simple
46-
, quickcheck-instances
47-
, QuickCheck
34+
type: exitcode-stdio-1.0
35+
ghc-options: -Wall -O2 -threaded
36+
default-language: Haskell2010
37+
hs-source-dirs: src
38+
main-is: Spec.hs
39+
40+
-- Initial posts.cabal generated by cabal init. For further documentation,
41+
-- see http://haskell.org/cabal/users-guide/
42+
43+
build-depends:
44+
aeson >=0.9 && <0.12
45+
, base >=4 && <5
46+
, hspec >=2 && <3
47+
, postgresql-simple
48+
, QuickCheck
49+
, quickcheck-instances
50+
, servant-quickcheck
51+
, servant-server >=0.5 && <0.8
52+
, text >=1 && <2
53+
, transformers >=0.4 && <0.5
54+
, warp >=3.0 && <3.3

0 commit comments

Comments
 (0)