Update the GitHub actions status badge #5
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: | |
jobs: | |
cabal: | |
name: ${{ matrix.os }} / ghc-${{ matrix.ghc }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
# https://www.haskell.org/ghc/ | |
# https://hackage.haskell.org/package/cabal-install | |
cabal: ["3.10"] | |
ghc: ["8.10", "9.4", "9.6", "9.8"] | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
- name: Setup Haskell | |
id: setup-haskell-cabal | |
uses: haskell/actions/setup@v2 | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
- name: Configure and Freeze for Cache | |
run: | | |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct | |
cabal freeze | |
- name: Cache ~/.cabal/store | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | |
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | |
- name: Build | |
run: cabal build '--build-log=logs/$pkgid' | |
- name: Test | |
run: cabal test | |
- name: Upload Build Logs on Failure | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: logs-${{ matrix.os }}-ghc${{ matrix.ghc }} | |
path: logs/ | |
- name: Install | |
run: cabal install --installdir=artifacts --install-method=copy | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }}-ghc${{ matrix.ghc }} | |
path: artifacts/ |