brittany/.github/workflows/ci.yaml

51 lines
1.4 KiB
YAML

name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-11
- ubuntu-20.04
- windows-2019
ghc:
- 9.0.1
cabal:
- 3.6.2.0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: mkdir artifact
- run: mkdir artifact/${{ matrix.os }}
- id: setup-haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: cabal configure --enable-tests
- run: cabal freeze
- run: cat cabal.project.freeze
- uses: actions/cache@v2
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-
${{ matrix.os }}-${{ matrix.ghc }}-
- run: cabal build
- run: cabal install --installdir artifact/${{ matrix.os }} --install-method copy
- run: cabal test --test-show-details direct
- run: cabal check
- run: cabal sdist --output-dir artifact/${{ matrix.os }}
- uses: actions/upload-artifact@v2
with:
path: artifact
name: brittany-${{ github.sha }}