Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #87 from MangoIV/mangoiv/newser-servant-base-ghc
Browse files Browse the repository at this point in the history
[feat] fix build with recent servant versions
  • Loading branch information
tchoutri authored Apr 2, 2024
2 parents 0535413 + c5ae93e commit b726071
Show file tree
Hide file tree
Showing 16 changed files with 484 additions and 149 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake . -Lv
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: haskell ci
on:
push:
pull_request:
workflow_dispatch:
jobs:
generate-matrix:
name: "Generate matrix from cabal"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
runs-on: ubuntu-latest
steps:
- name: Extract the tested GHC versions
id: set-matrix
uses: kleidukos/get-tested@v0.1.7.0
with:
cabal-file: servant-quickcheck.cabal
ubuntu-version: latest
macos-version: latest
windows-version: latest
version: 0.1.7.0
tests:
name: ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generate-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
- name: Cache
uses: actions/cache@v4.0.1
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ matrix.os }}-ghc-${{ matrix.ghc }}-cabal-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ matrix.os }}-ghc-${{ matrix.ghc }}-
- run: cabal test all
19 changes: 19 additions & 0 deletions .github/workflows/nix-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: nix ci
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix -L flake check
- run: nix -L build .#servant-quickcheck
- run: nix -L build .#ghc94-servant-quickcheck
- run: nix -L build .#ghc98-servant-quickcheck
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ samples/
test-servers/
/doc/
.stack-work/
.pre-commit-config.yaml
.direnv
dist*
result*
5 changes: 5 additions & 0 deletions CHANGELOG.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
releases:
- version: "0.1.0.0"
changes:
- 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"
authors: mangoiv
date: 2024-04-02
- version: "0.0.9.0"
changes:
- description: "Support servant-0.15 (#65)"
Expand Down
2 changes: 0 additions & 2 deletions Setup.hs

This file was deleted.

7 changes: 0 additions & 7 deletions cabal.haskell-ci

This file was deleted.

12 changes: 11 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
packages: .
packages:
./.

-- due to a bug in the nixpkgs haskell infrastructure (or cabal, if you will)
-- it is impossible to provided hspec-discover in a devShell therefore having
-- to resort to downloads from hackage
repository hackage.haskell.org
url: http://hackage.haskell.org/

tests: true

allow-newer: servant-blaze:servant

test-show-details: direct
50 changes: 26 additions & 24 deletions doc/doc.cabal
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: doc
version: 0.1.0.0
license: BSD3
license-file: LICENSE
author: Julian K. Arni
maintainer: jkarni@gmail.com
build-type: Simple
cabal-version: >=1.10
name: doc
version: 0.1.0.0
license: BSD3
license-file: LICENSE
author: Julian K. Arni
maintainer: jkarni@gmail.com
build-type: Simple
cabal-version: >=1.10

-- library
-- exposed-modules: ServersEqual
Expand Down Expand Up @@ -39,19 +39,21 @@ cabal-version: >=1.10
-- ghc-options: -Wall -Werror -pgmL markdown-unlit

executable announcement
main-is: Announcement.lhs
build-depends: base >=4.8 && <4.9
, servant-server == 0.7.*
, servant-quickcheck
, servant-client
, QuickCheck
, stm
, containers
, transformers
, warp
, aeson
, hspec
, postgresql-simple
, text
default-language: Haskell2010
ghc-options: -Wall
main-is: Announcement.lhs
build-depends:
aeson
, base >=4.8 && <4.9
, containers
, hspec
, postgresql-simple
, QuickCheck
, servant-client
, servant-quickcheck
, servant-server >=0.7 && <0.8
, stm
, text
, transformers
, warp

default-language: Haskell2010
ghc-options: -Wall
81 changes: 44 additions & 37 deletions doc/posts/posts.cabal
Original file line number Diff line number Diff line change
@@ -1,47 +1,54 @@
-- Initial posts.cabal generated by cabal init. For further documentation,
-- see http://haskell.org/cabal/users-guide/
name: posts
version: 0.1.0.0

name: posts
version: 0.1.0.0
-- synopsis:
-- description:
license: BSD3
license-file: LICENSE
author: Julian K. Arni
maintainer: jkarni@gmail.com
license: BSD3
license-file: LICENSE
author: Julian K. Arni
maintainer: jkarni@gmail.com

-- copyright:
-- category:
build-type: Simple
build-type: Simple

-- extra-source-files:
cabal-version: >=1.10
cabal-version: >=1.10

executable posts
main-is: Main.hs
build-depends: base >=4.8 && <4.9
, servant-server >=0.5 && <0.8
, aeson >=0.9 && <0.12
, text == 1.*
, warp >=3.0 && <3.3
, transformers >=0.4 && <0.5
, postgresql-simple
hs-source-dirs: src
ghc-options: -Wall -O2 -threaded
default-language: Haskell2010
main-is: Main.hs
build-depends:
aeson >=0.9 && <0.12
, base >=4.8 && <4.9
, postgresql-simple
, servant-server >=0.5 && <0.8
, text >=1 && <2
, transformers >=0.4 && <0.5
, warp >=3.0 && <3.3

hs-source-dirs: src
ghc-options: -Wall -O2 -threaded
default-language: Haskell2010

test-suite spec
type: exitcode-stdio-1.0
ghc-options: -Wall -O2 -threaded
default-language: Haskell2010
hs-source-dirs: src
main-is: Spec.hs
build-depends: base == 4.*
, servant-quickcheck
, hspec == 2.*
, servant-server >=0.5 && <0.8
, aeson >=0.9 && <0.12
, text == 1.*
, warp >=3.0 && <3.3
, transformers >=0.4 && <0.5
, postgresql-simple
, quickcheck-instances
, QuickCheck
type: exitcode-stdio-1.0
ghc-options: -Wall -O2 -threaded
default-language: Haskell2010
hs-source-dirs: src
main-is: Spec.hs

-- Initial posts.cabal generated by cabal init. For further documentation,
-- see http://haskell.org/cabal/users-guide/

build-depends:
aeson >=0.9 && <0.12
, base >=4 && <5
, hspec >=2 && <3
, postgresql-simple
, QuickCheck
, quickcheck-instances
, servant-quickcheck
, servant-server >=0.5 && <0.8
, text >=1 && <2
, transformers >=0.4 && <0.5
, warp >=3.0 && <3.3
Loading

0 comments on commit b726071

Please sign in to comment.