roboservant/.github/workflows/ci.yml
2021-03-22 18:34:56 -07:00

40 lines
1.2 KiB
YAML

name: Stack CI
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
jobs:
stack:
name: ${{ matrix.os }}-${{ matrix.ghc }}-stack
runs-on: ${{ matrix.os }}
strategy:
matrix:
stack: ["2.3.3"]
ghc: ["8.10.4"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
- uses: actions/setup-haskell@v1.1.4
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}
enable-stack: true
- uses: actions/cache@v1
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
- name: Test
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
run: |
stack test