hapistrano/.github/workflows/ci.yml

54 lines
1.5 KiB
YAML
Raw Normal View History

# 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
---
name: CI
on: push
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
ghc:
- "9.0"
- "8.10"
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
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "3.6"
2022-04-26 05:48:34 +03:00
id: setup-haskell
- 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') }}
path: |
2022-04-26 05:48:34 +03:00
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
2022-04-26 05:48:34 +03:00
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
- run: cabal build
- run: cabal test
2022-04-26 05:48:34 +03:00
- run: ./script/haddock