Merge pull request #1 from psibi/release #4
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: Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
jobs: | |
build: | |
name: CI | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
resolver: [nightly, lts-21, lts-20, lts-19] | |
# Bugs in GHC make it crash too often to be worth running | |
#exclude: | |
# - os: windows-latest | |
# resolver: nightly | |
steps: | |
- name: Clone project | |
uses: actions/checkout@v3 | |
- name: Cache dependencies on Unix-like OS | |
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') | |
uses: actions/cache@v3 | |
with: | |
path: ~/.stack | |
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }} | |
- name: Cache dependencies on Windows | |
if: startsWith(runner.os, 'Windows') | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~\AppData\Roaming\stack | |
~\AppData\Local\Programs\stack | |
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }} | |
- name: Build and run tests | |
shell: bash | |
run: | | |
set -ex | |
curl -sSL https://get.haskellstack.org/ | sh -s - -f | |
stack test --fast --no-terminal --resolver=${{ matrix.resolver }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
generate_release_notes: true |