2021-03-02 21:46:04 +01:00
|
|
|
name: CI
|
|
|
|
|
2021-03-17 21:32:04 +01:00
|
|
|
# Trigger the workflow on push or pull request, but only for the master branch
|
2021-03-02 21:46:04 +01:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
cabal:
|
|
|
|
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-03-16 10:23:23 +01:00
|
|
|
os: [ubuntu-latest]
|
2022-02-03 08:50:10 +01:00
|
|
|
cabal: ["3.6"]
|
2021-03-02 21:46:04 +01:00
|
|
|
ghc:
|
2021-03-16 18:32:21 +01:00
|
|
|
- "8.6.5"
|
2021-03-02 21:46:04 +01:00
|
|
|
- "8.8.4"
|
2021-10-02 19:16:32 +02:00
|
|
|
- "8.10.7"
|
2022-02-03 08:50:10 +01:00
|
|
|
- "9.0.2"
|
2022-02-25 04:24:59 +01:00
|
|
|
- "9.2.2"
|
2021-03-02 21:46:04 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-03-17 23:14:56 +01:00
|
|
|
- uses: haskell/actions/setup@v1
|
2021-03-02 21:46:04 +01:00
|
|
|
id: setup-haskell-cabal
|
|
|
|
name: Setup Haskell
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
cabal-version: ${{ matrix.cabal }}
|
|
|
|
|
|
|
|
- name: Freeze
|
|
|
|
run: |
|
2021-03-18 11:41:18 +01:00
|
|
|
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
|
2021-03-02 21:46:04 +01:00
|
|
|
cabal freeze
|
|
|
|
|
|
|
|
- uses: actions/cache@v2.1.3
|
2021-03-18 11:41:18 +01:00
|
|
|
name: Cache ~/.cabal/store and dist-newstyle
|
2021-03-02 21:46:04 +01:00
|
|
|
with:
|
2021-03-18 11:41:18 +01:00
|
|
|
path: |
|
|
|
|
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
|
|
|
|
dist-newstyle
|
2021-03-02 21:46:04 +01:00
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
|
2021-03-18 11:41:18 +01:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-
|
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
run: |
|
2022-03-08 04:32:15 +01:00
|
|
|
cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.20'
|
2021-03-02 21:46:04 +01:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cabal build all
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
cabal test all
|
|
|
|
|
2021-03-16 10:23:23 +01:00
|
|
|
- name: Run doctests
|
2021-06-22 15:41:13 +02:00
|
|
|
# doctests are broken on GHC 9 due to compiler bug:
|
|
|
|
# https://gitlab.haskell.org/ghc/ghc/-/issues/19460
|
|
|
|
continue-on-error: ${{ matrix.ghc == '9.0.1' }}
|
2021-03-16 10:23:23 +01:00
|
|
|
run: |
|
|
|
|
# Necessary for doctest to be found in $PATH
|
|
|
|
export PATH="$HOME/.cabal/bin:$PATH"
|
|
|
|
|
2022-03-08 04:32:15 +01:00
|
|
|
DOCTEST="cabal repl --with-ghc=doctest --ghc-options=-w"
|
|
|
|
(cd servant && eval $DOCTEST)
|
|
|
|
(cd servant-client && eval $DOCTEST)
|
|
|
|
(cd servant-client-core && eval $DOCTEST)
|
|
|
|
(cd servant-http-streams && eval $DOCTEST)
|
|
|
|
(cd servant-docs && eval $DOCTEST)
|
|
|
|
(cd servant-foreign && eval $DOCTEST)
|
|
|
|
(cd servant-server && eval $DOCTEST)
|
|
|
|
(cd servant-machines && eval $DOCTEST)
|
|
|
|
(cd servant-conduit && eval $DOCTEST)
|
|
|
|
(cd servant-pipes && eval $DOCTEST)
|
2021-03-16 10:23:23 +01:00
|
|
|
|
2021-03-02 21:46:04 +01:00
|
|
|
stack:
|
|
|
|
name: stack / ghc ${{ matrix.ghc }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-08-21 19:15:02 +02:00
|
|
|
stack: ["2.7.3"]
|
2022-02-03 08:50:10 +01:00
|
|
|
ghc: ["8.10.7"]
|
2021-03-02 21:46:04 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-03-17 23:14:56 +01:00
|
|
|
- uses: haskell/actions/setup@v1
|
2021-03-02 21:46:04 +01:00
|
|
|
name: Setup Haskell Stack
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
stack-version: ${{ matrix.stack }}
|
|
|
|
|
|
|
|
- uses: actions/cache@v2.1.3
|
|
|
|
name: Cache ~/.stack
|
|
|
|
with:
|
|
|
|
path: ~/.stack
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
stack test --system-ghc
|
2021-03-17 10:28:04 +01:00
|
|
|
|
|
|
|
ghcjs:
|
2021-10-10 22:52:13 +02:00
|
|
|
name: ubuntu-latest / ghcjs 8.6
|
2021-10-09 13:27:01 +02:00
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: cachix/install-nix-action@v13
|
|
|
|
with:
|
|
|
|
extra_nix_config: |
|
|
|
|
trusted-public-keys = ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=1aba6f367982bd6dd78ec2fda75ab246a62d32c5 cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
|
|
|
|
substituters = https://nixcache.reflex-frp.org https://cache.nixos.org/
|
|
|
|
- name: Setup
|
|
|
|
run: |
|
|
|
|
# Override cabal.project with the lightweight GHCJS one
|
|
|
|
cp cabal.ghcjs.project cabal.project
|
|
|
|
cat cabal.project
|
|
|
|
nix-shell ghcjs.nix --run "cabal v2-update && cabal v2-freeze"
|
|
|
|
|
|
|
|
- uses: actions/cache@v2.1.3
|
|
|
|
name: Cache ~/.cabal/store and dist-newstyle
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cabal/store
|
|
|
|
dist-newstyle
|
|
|
|
key: ${{ runner.os }}-ghcjs8.6-${{ hashFiles('cabal.project.freeze') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-ghcjs8.6-
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
nix-shell ghcjs.nix --run "cabal v2-build --ghcjs --enable-tests --enable-benchmarks all"
|
|
|
|
|
|
|
|
- name: Tests
|
|
|
|
run: |
|
|
|
|
nix-shell ghcjs.nix --run ".github/run-ghcjs-tests.sh"
|