2021-01-26 03:55:07 +03:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
# 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:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
|
|
|
cabal: ["3.2"]
|
|
|
|
ghc:
|
|
|
|
- "8.6"
|
|
|
|
- "8.8"
|
|
|
|
- "8.10"
|
2021-07-09 23:25:39 +03:00
|
|
|
- "9.0"
|
2021-11-23 02:45:48 +03:00
|
|
|
- "9.2"
|
2023-03-14 02:39:50 +03:00
|
|
|
- "9.4"
|
|
|
|
- "latest"
|
2021-01-26 03:55:07 +03:00
|
|
|
exclude:
|
2021-11-23 02:45:48 +03:00
|
|
|
- os: macOS-latest
|
|
|
|
ghc: 9.0
|
2021-07-09 23:25:39 +03:00
|
|
|
- os: macOS-latest
|
|
|
|
ghc: 8.10
|
2021-01-26 03:55:07 +03:00
|
|
|
- os: macOS-latest
|
|
|
|
ghc: 8.8
|
|
|
|
- os: macOS-latest
|
|
|
|
ghc: 8.6
|
|
|
|
- os: macOS-latest
|
|
|
|
ghc: 8.4
|
|
|
|
- os: macOS-latest
|
|
|
|
ghc: 8.2
|
|
|
|
- os: macOS-latest
|
|
|
|
ghc: 8.0
|
2023-03-14 02:39:50 +03:00
|
|
|
- os: windows-latest
|
|
|
|
ghc: 9.0
|
2021-01-26 03:55:07 +03:00
|
|
|
- os: windows-latest
|
|
|
|
ghc: 8.10
|
2021-07-09 23:25:39 +03:00
|
|
|
- os: windows-latest
|
|
|
|
ghc: 8.8
|
2021-01-26 03:55:07 +03:00
|
|
|
- os: windows-latest
|
|
|
|
ghc: 8.6
|
|
|
|
- os: windows-latest
|
|
|
|
ghc: 8.4
|
|
|
|
- os: windows-latest
|
|
|
|
ghc: 8.2
|
|
|
|
- os: windows-latest
|
|
|
|
ghc: 8.0
|
|
|
|
|
|
|
|
steps:
|
2023-03-14 02:39:50 +03:00
|
|
|
- uses: actions/checkout@v3
|
2021-01-26 03:55:07 +03:00
|
|
|
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
|
|
|
|
|
2023-03-14 02:39:50 +03:00
|
|
|
- uses: haskell/actions/setup@v2
|
2021-01-26 03:55:07 +03:00
|
|
|
id: setup-haskell-cabal
|
|
|
|
name: Setup Haskell
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
cabal-version: ${{ matrix.cabal }}
|
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
run: |
|
|
|
|
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
|
|
|
|
|
|
|
|
- name: Freeze
|
|
|
|
run: |
|
|
|
|
cabal freeze
|
|
|
|
|
2021-05-15 01:03:57 +03:00
|
|
|
- uses: actions/cache@v2
|
2021-01-26 03:55:07 +03:00
|
|
|
name: Cache ~/.cabal/store
|
|
|
|
with:
|
|
|
|
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
cabal build all --only-dependencies
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cabal build all --enable-tests --enable-benchmarks --write-ghc-environment-files=always
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
cabal test all
|
|
|
|
|
|
|
|
- name: Test inspect
|
|
|
|
if: matrix.ghc == '8.10'
|
|
|
|
run: |
|
|
|
|
rm cabal.project.freeze
|
|
|
|
cabal test .:inspect --flags="enable-inspect"
|
|
|
|
|
|
|
|
stack:
|
|
|
|
name: stack / ghc ${{ matrix.ghc }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
stack: ["latest"]
|
2021-11-23 02:45:48 +03:00
|
|
|
ghc: ["9.2"]
|
2021-01-26 03:55:07 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
|
|
|
|
|
2021-02-01 02:27:25 +03:00
|
|
|
- uses: haskell/actions/setup@v1
|
2021-01-26 03:55:07 +03:00
|
|
|
name: Setup Haskell Stack
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
stack-version: ${{ matrix.stack }}
|
|
|
|
|
2021-05-15 01:03:57 +03:00
|
|
|
- uses: actions/cache@v2
|
2021-01-26 03:55:07 +03:00
|
|
|
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
|