on master help sign in
148 lines 4.2 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"
23 - "9.4.2"
25 steps:
26 - uses: actions/checkout@v2
28 - uses: haskell/actions/setup@v1
29 id: setup-haskell-cabal
30 name: Setup Haskell
31 with:
32 ghc-version: ${{ matrix.ghc }}
33 cabal-version: ${{ matrix.cabal }}
35 - name: Freeze
36 run: |
37 cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
38 cabal freeze
40 - uses: actions/cache@v2.1.3
41 name: Cache ~/.cabal/store and dist-newstyle
42 with:
43 path: |
44 ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
45 dist-newstyle
46 key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
47 restore-keys: |
48 ${{ runner.os }}-${{ matrix.ghc }}-
50 - name: Configure
51 run: |
52 cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.20'
54 - name: Build
55 run: |
56 cabal build all
58 - name: Test
59 run: |
60 cabal test all
62 - name: Run doctests
63 run: |
64 # Necessary for doctest to be found in $PATH
65 export PATH="$HOME/.cabal/bin:$PATH"
67 DOCTEST="cabal repl --with-ghc=doctest --ghc-options=-w"
68 (cd servant && eval $DOCTEST)
69 (cd servant-client && eval $DOCTEST)
70 (cd servant-client-core && eval $DOCTEST)
71 (cd servant-http-streams && eval $DOCTEST)
72 (cd servant-docs && eval $DOCTEST)
73 (cd servant-foreign && eval $DOCTEST)
74 (cd servant-server && eval $DOCTEST)
75 (cd servant-machines && eval $DOCTEST)
76 (cd servant-conduit && eval $DOCTEST)
77 (cd servant-pipes && eval $DOCTEST)
79 # stack:
80 # name: stack / ghc ${{ matrix.ghc }}
81 # runs-on: ubuntu-latest
82 # strategy:
83 # matrix:
84 # stack: ["2.7.5"]
85 # ghc: ["8.10.7"]
87 # steps:
88 # - uses: actions/checkout@v2
90 # - uses: haskell/actions/setup@v1
91 # name: Setup Haskell Stack
92 # with:
93 # ghc-version: ${{ matrix.ghc }}
94 # stack-version: ${{ matrix.stack }}
96 # - uses: actions/cache@v2.1.3
97 # name: Cache ~/.stack
98 # with:
99 # path: ~/.stack
100 # key: ${{ runner.os }}-${{ matrix.ghc }}-stack
102 # - name: Install dependencies
103 # run: |
104 # stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
106 # - name: Build
107 # run: |
108 # stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
110 # - name: Test
111 # run: |
112 # stack test --system-ghc
114 ghcjs:
115 name: ubuntu-latest / ghcjs 8.6
116 runs-on: "ubuntu-latest"
118 steps:
119 - uses: actions/checkout@v2
120 - uses: cachix/install-nix-action@v13
121 with:
122 extra_nix_config: |
123 trusted-public-keys = ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=1aba6f367982bd6dd78ec2fda75ab246a62d32c5 cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
124 substituters = https://nixcache.reflex-frp.org https://cache.nixos.org/
125 - name: Setup
126 run: |
127 # Override cabal.project with the lightweight GHCJS one
128 cp cabal.ghcjs.project cabal.project
129 cat cabal.project
130 nix-shell ghcjs.nix --run "cabal v2-update && cabal v2-freeze"
132 - uses: actions/cache@v2.1.3
133 name: Cache ~/.cabal/store and dist-newstyle
134 with:
135 path: |
136 ~/.cabal/store
137 dist-newstyle
138 key: ${{ runner.os }}-ghcjs8.6-${{ hashFiles('cabal.project.freeze') }}
139 restore-keys: |
140 ${{ runner.os }}-ghcjs8.6-
142 - name: Build
143 run: |
144 nix-shell ghcjs.nix --run "cabal v2-build --ghcjs --enable-tests --enable-benchmarks all"
146 - name: Tests
147 run: |
148 nix-shell ghcjs.nix --run ".github/run-ghcjs-tests.sh"