2022-04-01 21:45:11 +03:00
|
|
|
# The present workflow was made based on the following references:
|
|
|
|
# - https://github.com/actions/cache/blob/main/examples.md#haskell---cabal
|
|
|
|
# - https://github.com/haskell/time/blob/master/.github/workflows/ci.yml
|
|
|
|
# - https://github.com/stackbuilders/stache/blob/master/.github/workflows/ci.yaml
|
2022-04-26 05:48:34 +03:00
|
|
|
# - https://markkarpov.com/post/github-actions-for-haskell-ci.html
|
2022-04-11 22:42:59 +03:00
|
|
|
---
|
2022-04-01 21:45:11 +03:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
concurrency:
|
2022-04-11 22:42:59 +03:00
|
|
|
group: ci-${{ github.ref }}
|
2022-04-01 21:45:11 +03:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-04-09 18:53:58 +03:00
|
|
|
os:
|
|
|
|
- macos-latest
|
|
|
|
- ubuntu-latest
|
2022-04-01 21:45:11 +03:00
|
|
|
ghc:
|
2022-04-09 18:53:58 +03:00
|
|
|
- "9.0"
|
|
|
|
- "8.10"
|
2022-04-01 21:45:11 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-04-26 05:48:34 +03:00
|
|
|
- if: ${{ runner.os == 'Linux' }}
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install zsh
|
|
|
|
- if: ${{ runner.os == 'macOS' }}
|
|
|
|
run: |
|
|
|
|
brew update
|
|
|
|
brew install zsh
|
|
|
|
- uses: haskell/actions/setup@v2
|
2022-04-01 21:45:11 +03:00
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
2022-04-09 18:53:58 +03:00
|
|
|
cabal-version: "3.6"
|
2022-04-26 05:48:34 +03:00
|
|
|
id: setup-haskell
|
2022-04-01 21:45:11 +03:00
|
|
|
- run: cabal configure --enable-tests
|
|
|
|
- run: cabal freeze
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
2022-04-26 05:48:34 +03:00
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
|
2022-04-01 21:45:11 +03:00
|
|
|
path: |
|
2022-04-26 05:48:34 +03:00
|
|
|
${{ steps.setup-haskell.outputs.cabal-store }}
|
2022-04-01 21:45:11 +03:00
|
|
|
dist-newstyle
|
2022-04-26 05:48:34 +03:00
|
|
|
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
|
2022-04-01 21:45:11 +03:00
|
|
|
- run: cabal build
|
|
|
|
- run: cabal test
|
2022-04-26 05:48:34 +03:00
|
|
|
- run: ./script/haddock
|