git.iko.soy/typeable/servant
on servant-auth-uverb help sign in
150 lines 4.3 kB history raw
1name: CI
3# Trigger the workflow on push or pull request, but only for the master branch
4on:
5 pull_request:
6 push:
7 branches: [master]
9jobs:
10 cabal:
11 name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
12 runs-on: ${{ matrix.os }}
13 strategy:
14 matrix:
15 os: [ubuntu-latest]
16 cabal: ["3.6"]
17 ghc:
18 - "8.6.5"
19 - "8.8.4"
20 - "8.10.7"
21 - "9.0.2"
22 - "9.2.2"
24 steps:
25 - uses: actions/checkout@v2
27 - uses: haskell/actions/setup@v1
28 id: setup-haskell-cabal
29 name: Setup Haskell
30 with:
31 ghc-version: ${{ matrix.ghc }}
32 cabal-version: ${{ matrix.cabal }}
34 - name: Freeze
35 run: |
36 cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
37 cabal freeze
39 - uses: actions/cache@v2.1.3
40 name: Cache ~/.cabal/store and dist-newstyle
41 with:
42 path: |
43 ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
44 dist-newstyle
45 key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
46 restore-keys: |
47 ${{ runner.os }}-${{ matrix.ghc }}-
49 - name: Configure
50 run: |
51 cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.20'
53 - name: Build
54 run: |
55 cabal build all
57 - name: Test
58 run: |
59 cabal test all
61 - name: Run doctests
62 # doctests are broken on GHC 9 due to compiler bug:
63 # https://gitlab.haskell.org/ghc/ghc/-/issues/19460
64 continue-on-error: ${{ matrix.ghc == '9.0.1' }}
65 run: |
66 # Necessary for doctest to be found in $PATH
67 export PATH="$HOME/.cabal/bin:$PATH"
69 DOCTEST="cabal repl --with-ghc=doctest --ghc-options=-w"
70 (cd servant && eval $DOCTEST)
71 (cd servant-client && eval $DOCTEST)
72 (cd servant-client-core && eval $DOCTEST)
73 (cd servant-http-streams && eval $DOCTEST)
74 (cd servant-docs && eval $DOCTEST)
75 (cd servant-foreign && eval $DOCTEST)
76 (cd servant-server && eval $DOCTEST)
77 (cd servant-machines && eval $DOCTEST)
78 (cd servant-conduit && eval $DOCTEST)
79 (cd servant-pipes && eval $DOCTEST)
81 stack:
82 name: stack / ghc ${{ matrix.ghc }}
83 runs-on: ubuntu-latest
84 strategy:
85 matrix:
86 stack: ["2.7.3"]
87 ghc: ["8.10.7"]
89 steps:
90 - uses: actions/checkout@v2
92 - uses: haskell/actions/setup@v1
93 name: Setup Haskell Stack
94 with:
95 ghc-version: ${{ matrix.ghc }}
96 stack-version: ${{ matrix.stack }}
98 - uses: actions/cache@v2.1.3
99 name: Cache ~/.stack
100 with:
101 path: ~/.stack
102 key: ${{ runner.os }}-${{ matrix.ghc }}-stack
104 - name: Install dependencies
105 run: |
106 stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
108 - name: Build
109 run: |
110 stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
112 - name: Test
113 run: |
114 stack test --system-ghc
116 ghcjs:
117 name: ubuntu-latest / ghcjs 8.6
118 runs-on: "ubuntu-latest"
120 steps:
121 - uses: actions/checkout@v2
122 - uses: cachix/install-nix-action@v13
123 with:
124 extra_nix_config: |
125 trusted-public-keys = ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=1aba6f367982bd6dd78ec2fda75ab246a62d32c5 cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
126 substituters = https://nixcache.reflex-frp.org https://cache.nixos.org/
127 - name: Setup
128 run: |
129 # Override cabal.project with the lightweight GHCJS one
130 cp cabal.ghcjs.project cabal.project
131 cat cabal.project
132 nix-shell ghcjs.nix --run "cabal v2-update && cabal v2-freeze"
134 - uses: actions/cache@v2.1.3
135 name: Cache ~/.cabal/store and dist-newstyle
136 with:
137 path: |
138 ~/.cabal/store
139 dist-newstyle
140 key: ${{ runner.os }}-ghcjs8.6-${{ hashFiles('cabal.project.freeze') }}
141 restore-keys: |
142 ${{ runner.os }}-ghcjs8.6-
144 - name: Build
145 run: |
146 nix-shell ghcjs.nix --run "cabal v2-build --ghcjs --enable-tests --enable-benchmarks all"
148 - name: Tests
149 run: |
150 nix-shell ghcjs.nix --run ".github/run-ghcjs-tests.sh"