wasp/.github/workflows/ci.yaml
2020-11-14 10:41:02 +01:00

68 lines
1.6 KiB
YAML

name: CI
on:
push: { branches: [master] }
pull_request: { branches: [master] }
create: { tags: [v*] }
defaults:
run:
shell: bash
working-directory: waspc
jobs:
cancel:
name: Cancel redundant actions already in progress
runs-on: ubuntu-latest
steps:
- name: Cancel actions in progress of same workflow and same branch
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
build:
name: Build Wasp
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# TODO: We did not take Windows into account here.
# From what we know so far they use different paths, so we should
# add those also to cache (conditionally?).
- name: Set up cache
uses: actions/cache@v2
with:
path: |
$HOME/.ghc
$HOME/.cabal
$HOME/.stack
key: haskell-${{ runner.os }}-${{ hashFiles('waspc/stack.yaml') }}
- name: Set up environment
uses: actions/setup-haskell@v1
with:
ghc-version: latest
enable-stack: true
stack-version: latest
- name: Verify environment
run: |
stack --numeric-version
ghc --version
- name: Build dependencies
run: stack --install-ghc test --only-dependencies
- name: Build Wasp & Run tests
run: stack test
# TODO: Add deployment of binaries to Github release.