Skip to content

CI: Always save cache, even on failure #62

CI: Always save cache, even on failure

CI: Always save cache, even on failure #62

Workflow file for this run

name: CI
on:
push:
env:
# The CACHE_VERSION can be updated to force the use of a new cache if
# the current cache contents become corrupted/invalid. This can
# sometimes happen when (for example) the OS version is changed but
# older .so files are cached, which can have various effects
# (e.g. cabal complains it can't find a valid version of the "happy"
# tool).
CACHE_VERSION: 1
jobs:
build-linux:
runs-on: ubuntu-20.04
strategy:
matrix:
os: [ubuntu-22.04]
ghc-ver: ["9.4.8", "9.6.4", "9.8.1"]
cabal: ["3.10.2.0"]
# complete all jobs
fail-fast: false
name: GHC v${{ matrix.ghc-ver }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Copy cabal project files
run: |
cp cabal.project.dist cabal.project
cp cabal.project.werror cabal.project.local
cp cabal.project.ghc-${{ matrix.ghc-ver }}.freeze cabal.project.freeze
- uses: haskell/actions/setup@v1
id: setup-haskell
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc-ver }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache/restore@v3
name: Restore cabal store cache
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
key: ${{ env.CACHE_VERSION }}-cabal-${{ matrix.os }}-${{ matrix.ghc-ver }}-${{ hashFiles(format('cabal.project.ghc-{0}.freeze', matrix.ghc-ver)) }}-${{ github.sha }}
restore-keys: |
${{ env.CACHE_VERSION }}-cabal-${{ matrix.os }}-${{ matrix.ghc-ver }}-${{ hashFiles(format('cabal.project.ghc-{0}.freeze', matrix.ghc-ver)) }}-
- name: Cabal update
run: cabal update
- name: Build
run: cabal build

Check failure on line 53 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yaml

Invalid workflow file

You have an error in your yaml syntax on line 53
- name: Test
run: cabal test
- uses: actions/cache/save@v3
name: Save cabal store cache
if: always()
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
key: ${{ env.CACHE_VERSION }}-cabal-${{ matrix.os }}-${{ matrix.ghc-ver }}-${{ hashFiles(format('cabal.project.ghc-{0}.freeze', matrix.ghc-ver)) }}-${{ github.sha }}