git.iko.soy/typeable/servant
on master help sign in
147 lines 4.1 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 run: |
63 # Necessary for doctest to be found in $PATH
64 export PATH="$HOME/.cabal/bin:$PATH"
66 DOCTEST="cabal repl --with-ghc=doctest --ghc-options=-w"
67 (cd servant && eval $DOCTEST)
68 (cd servant-client && eval $DOCTEST)
69 (cd servant-client-core && eval $DOCTEST)
70 (cd servant-http-streams && eval $DOCTEST)
71 (cd servant-docs && eval $DOCTEST)
72 (cd servant-foreign && eval $DOCTEST)
73 (cd servant-server && eval $DOCTEST)
74 (cd servant-machines && eval $DOCTEST)
75 (cd servant-conduit && eval $DOCTEST)
76 (cd servant-pipes && eval $DOCTEST)
78 stack:
79 name: stack / ghc ${{ matrix.ghc }}
80 runs-on: ubuntu-latest
81 strategy:
82 matrix:
83 stack: ["2.7.5"]
84 ghc: ["8.10.7"]
86 steps:
87 - uses: actions/checkout@v2
89 - uses: haskell/actions/setup@v1
90 name: Setup Haskell Stack
91 with:
92 ghc-version: ${{ matrix.ghc }}
93 stack-version: ${{ matrix.stack }}
95 - uses: actions/cache@v2.1.3
96 name: Cache ~/.stack
97 with:
98 path: ~/.stack
99 key: ${{ runner.os }}-${{ matrix.ghc }}-stack
101 - name: Install dependencies
102 run: |
103 stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
105 - name: Build
106 run: |
107 stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
109 - name: Test
110 run: |
111 stack test --system-ghc
113 ghcjs:
114 name: ubuntu-latest / ghcjs 8.6
115 runs-on: "ubuntu-latest"
117 steps:
118 - uses: actions/checkout@v2
119 - uses: cachix/install-nix-action@v13
120 with:
121 extra_nix_config: |
122 trusted-public-keys = ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=1aba6f367982bd6dd78ec2fda75ab246a62d32c5 cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
123 substituters = https://nixcache.reflex-frp.org https://cache.nixos.org/
124 - name: Setup
125 run: |
126 # Override cabal.project with the lightweight GHCJS one
127 cp cabal.ghcjs.project cabal.project
128 cat cabal.project
129 nix-shell ghcjs.nix --run "cabal v2-update && cabal v2-freeze"
131 - uses: actions/cache@v2.1.3
132 name: Cache ~/.cabal/store and dist-newstyle
133 with:
134 path: |
135 ~/.cabal/store
136 dist-newstyle
137 key: ${{ runner.os }}-ghcjs8.6-${{ hashFiles('cabal.project.freeze') }}
138 restore-keys: |
139 ${{ runner.os }}-ghcjs8.6-
141 - name: Build
142 run: |
143 nix-shell ghcjs.nix --run "cabal v2-build --ghcjs --enable-tests --enable-benchmarks all"
145 - name: Tests
146 run: |
147 nix-shell ghcjs.nix --run ".github/run-ghcjs-tests.sh"