Haskell CI #752
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Haskell CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
# run at the start of every day | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
ghc: ['9.0', '9.8'] | |
os: [ubuntu-20.04] | |
name: ${{ matrix.os }} GHC ${{ matrix.ghc }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
- name: Install Ubuntu dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libusb-1.0-0-dev | |
- name: configure | |
run: | | |
cabal configure --enable-tests --enable-benchmarks --disable-documentation | |
cabal build --dry-run | |
- name: restore cached dependencies | |
uses: actions/cache/restore@v3 | |
id: cache | |
env: | |
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.key }}- | |
- name: build haskell dependencies | |
run: cabal build all --only-dependencies | |
- name: save cached dependencies | |
uses: actions/cache/save@v3 | |
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: build | |
run: cabal build all | |
- name: test | |
run: cabal test all | |
- name: check | |
run: cabal check | |
- name: documentation | |
run: cabal haddock all |