WIP #58
Workflow file for this run
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: CI | |
# Trigger the workflow on push or pull request, but only for the master branch | |
on: | |
pull_request: | |
push: | |
# branches: [master] | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
# TODO: Not sure how to cache this one.. cachix? | |
nix: | |
name: nix build | |
runs-on: ubuntu-latest | |
container: | |
image: 'nixos/nix:2.3.6' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: | | |
nix-build | |
cabal: | |
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
cabal: ["3.6"] | |
ghc: | |
- "8.6.5" | |
- "8.10.7" | |
- "9.0.2" | |
- "9.2.8" | |
steps: | |
- uses: actions/checkout@v3 | |
# if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' | |
- uses: haskell-actions/setup@v2 | |
id: setup-haskell-cabal | |
name: Setup Haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
- name: Freeze | |
run: | | |
cabal update | |
cabal freeze | |
- uses: actions/cache@v1 | |
name: Cache ~/.cabal/store | |
with: | |
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | |
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze', 'cabal.project') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.ghc }}- | |
- name: Build | |
run: | | |
cabal build all --write-ghc-environment-files=always | |
ghc -iexample Example | |
ghc -iexample Testing | |
- name: Test | |
run: | | |
cabal test all |