git.iko.soy/typeable/servant
on prepare-0.19 help sign in
159 lines 5.0 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.4"]
17 ghc:
18 - "8.6.5"
19 - "8.8.4"
20 - "8.10.7"
21 - "9.0.1"
23 steps:
24 - uses: actions/checkout@v2
26 - uses: haskell/actions/setup@v1
27 id: setup-haskell-cabal
28 name: Setup Haskell
29 with:
30 ghc-version: ${{ matrix.ghc }}
31 cabal-version: ${{ matrix.cabal }}
33 - name: Freeze
34 run: |
35 cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
36 cabal freeze
38 - uses: actions/cache@v2.1.3
39 name: Cache ~/.cabal/store and dist-newstyle
40 with:
41 path: |
42 ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
43 dist-newstyle
44 key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
45 restore-keys: |
46 ${{ runner.os }}-${{ matrix.ghc }}-
48 - name: Configure
49 run: |
50 # Using separate store-dir because default one already has 'ghc-paths' package installed
51 # with hardcoded path to ghcup's GHC path (which it was built with). This leads to failure in
52 # doctest, as it tries to invoke that GHC, and it doesn't exist here.
53 cabal --store-dir /tmp/cabal-store install --ignore-project -j2 doctest --constraint='doctest ^>=0.18'
55 - name: Build
56 run: |
57 cabal build all
59 - name: Test
60 run: |
61 cabal test all
63 - name: Run doctests
64 # doctests are broken on GHC 9 due to compiler bug:
65 # https://gitlab.haskell.org/ghc/ghc/-/issues/19460
66 continue-on-error: ${{ matrix.ghc == '9.0.1' }}
67 run: |
68 # Necessary for doctest to be found in $PATH
69 export PATH="$HOME/.cabal/bin:$PATH"
71 # Filter out base-compat-batteries from .ghc.environment.*, as its modules
72 # conflict with those of base-compat.
73 #
74 # FIXME: This is an ugly hack. Ultimately, we'll want to use cabal-doctest
75 # (or cabal v2-doctest, if it ever lands) to provide a clean GHC environment.
76 # This might allow running doctests in GHCJS build as well.
77 perl -i -e 'while (<ARGV>) { print unless /package-id\s+(base-compat-batteries)-\d+(\.\d+)*/; }' .ghc.environment.*
79 (cd servant && doctest src)
80 (cd servant-client && doctest src)
81 (cd servant-client-core && doctest src)
82 (cd servant-http-streams && doctest src)
83 (cd servant-docs && doctest src)
84 (cd servant-foreign && doctest src)
85 (cd servant-server && doctest src)
86 (cd servant-machines && doctest src)
87 (cd servant-conduit && doctest src)
88 (cd servant-pipes && doctest src)
90 stack:
91 name: stack / ghc ${{ matrix.ghc }}
92 runs-on: ubuntu-latest
93 strategy:
94 matrix:
95 stack: ["2.7.3"]
96 ghc: ["8.10.4"]
98 steps:
99 - uses: actions/checkout@v2
101 - uses: haskell/actions/setup@v1
102 name: Setup Haskell Stack
103 with:
104 ghc-version: ${{ matrix.ghc }}
105 stack-version: ${{ matrix.stack }}
107 - uses: actions/cache@v2.1.3
108 name: Cache ~/.stack
109 with:
110 path: ~/.stack
111 key: ${{ runner.os }}-${{ matrix.ghc }}-stack
113 - name: Install dependencies
114 run: |
115 stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
117 - name: Build
118 run: |
119 stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
121 - name: Test
122 run: |
123 stack test --system-ghc
125 ghcjs:
126 name: ubuntu-latest / ghcjs 8.6
127 runs-on: "ubuntu-latest"
129 steps:
130 - uses: actions/checkout@v2
131 - uses: cachix/install-nix-action@v13
132 with:
133 extra_nix_config: |
134 trusted-public-keys = ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=1aba6f367982bd6dd78ec2fda75ab246a62d32c5 cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
135 substituters = https://nixcache.reflex-frp.org https://cache.nixos.org/
136 - name: Setup
137 run: |
138 # Override cabal.project with the lightweight GHCJS one
139 cp cabal.ghcjs.project cabal.project
140 cat cabal.project
141 nix-shell ghcjs.nix --run "cabal v2-update && cabal v2-freeze"
143 - uses: actions/cache@v2.1.3
144 name: Cache ~/.cabal/store and dist-newstyle
145 with:
146 path: |
147 ~/.cabal/store
148 dist-newstyle
149 key: ${{ runner.os }}-ghcjs8.6-${{ hashFiles('cabal.project.freeze') }}
150 restore-keys: |
151 ${{ runner.os }}-ghcjs8.6-
153 - name: Build
154 run: |
155 nix-shell ghcjs.nix --run "cabal v2-build --ghcjs --enable-tests --enable-benchmarks all"
157 - name: Tests
158 run: |
159 nix-shell ghcjs.nix --run ".github/run-ghcjs-tests.sh"