Skip to content

CI: Document why always() is needed in actions/cache/save #61

CI: Document why always() is needed in actions/cache/save

CI: Document why always() is needed in actions/cache/save #61

Workflow file for this run

# This CI configuration is inspired by
#
# https://kodimensional.dev/github-actions
#
# It builds with a majority of the latest compiler releases from each major GHC
# revision on Linux and builds macOS and Windows against the latest GHC.
name: CI Matrix
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
arch: ['tablegen', 'arm', 'thumb', 'ppc', 'aarch64', 'arm-xml']
ghc: ['9.4.8', '9.6.6', '9.8.2']
cabal: ['3.10.3.0']
os: [ubuntu-latest, macOS-latest, windows-latest]
exclude:
# Only test macOS and Windows on the latest supported GHC versions
- os: macOS-latest
ghc: 9.4.8
- os: macOS-latest
ghc: 9.6.6
- os: windows-latest
ghc: 9.4.8
- os: windows-latest
ghc: 9.6.6
# This configuration runs out of memory
- os: windows-latest
arch: aarch64
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} dismantle-${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache/restore@v4
name: Restore cabal store cache
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
- name: Build
run: |
cp cabal.project.newbuild cabal.project
cabal v2-configure pkg:dismantle-${{ matrix.arch }} --write-ghc-environment-files=always -j1
cabal v2-build pkg:dismantle-${{ matrix.arch }}
- name: Test
if: runner.os == 'Linux'
run: |
cabal v2-test pkg:dismantle-${{ matrix.arch }}
- uses: actions/cache/save@v4
name: Save cabal store cache
# Always save the cache, even if a previous step fails. (By default, the
# `cache` action will skip saving the cache, which would require every
# subsequent CI job to rebuild the dependencies until there is a
# successful job.)
if: always()
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal