2020-07-15 04:06:12 +03:00
|
|
|
name: sandwich
|
2020-07-15 02:15:03 +03:00
|
|
|
|
|
|
|
# Trigger the workflow on push or pull request, but only for the master branch
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
cabal:
|
|
|
|
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2021-04-26 01:08:00 +03:00
|
|
|
fail-fast: false
|
2020-07-15 02:15:03 +03:00
|
|
|
matrix:
|
2020-07-15 04:10:49 +03:00
|
|
|
os: [ubuntu-latest, macOS-latest]
|
2020-07-15 02:15:03 +03:00
|
|
|
cabal: ["3.2"]
|
|
|
|
ghc:
|
|
|
|
- "8.6.5"
|
|
|
|
- "8.8.3"
|
|
|
|
- "8.10.1"
|
2021-05-28 04:01:14 +03:00
|
|
|
- "9.0.1"
|
2020-07-15 04:10:49 +03:00
|
|
|
# exclude:
|
|
|
|
# - os: macOS-latest
|
|
|
|
# ghc: 8.8.3
|
2020-07-15 02:15:03 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
|
|
|
|
|
2021-05-28 03:39:14 +03:00
|
|
|
- uses: haskell/actions/setup@v1
|
2020-07-15 02:15:03 +03:00
|
|
|
id: setup-haskell-cabal
|
|
|
|
name: Setup Haskell
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
cabal-version: ${{ matrix.cabal }}
|
|
|
|
|
|
|
|
- name: Freeze
|
|
|
|
run: |
|
|
|
|
cd sandwich
|
|
|
|
cabal freeze
|
|
|
|
|
|
|
|
- uses: actions/cache@v1
|
|
|
|
name: Cache ~/.cabal/store
|
|
|
|
with:
|
|
|
|
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd sandwich
|
|
|
|
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
|
|
|
|
cabal build all
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
cd sandwich
|
|
|
|
cabal test all
|
|
|
|
|
|
|
|
stack:
|
|
|
|
name: stack / ghc ${{ matrix.ghc }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2021-04-26 01:08:00 +03:00
|
|
|
fail-fast: false
|
2020-07-15 02:15:03 +03:00
|
|
|
matrix:
|
|
|
|
stack: ["2.3.1"]
|
|
|
|
ghc: ["8.8.3"]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
|
|
|
|
|
2021-05-28 03:39:14 +03:00
|
|
|
- uses: haskell/actions/setup@v1
|
2020-07-15 02:15:03 +03:00
|
|
|
name: Setup Haskell Stack
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
stack-version: ${{ matrix.stack }}
|
2021-05-28 03:39:14 +03:00
|
|
|
enable-stack: true
|
2020-07-15 02:15:03 +03:00
|
|
|
|
|
|
|
- uses: actions/cache@v1
|
|
|
|
name: Cache ~/.stack
|
|
|
|
with:
|
|
|
|
path: ~/.stack
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd sandwich
|
|
|
|
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
cd sandwich
|
|
|
|
stack test --system-ghc
|