Skip to content

Unleash the matrix

Unleash the matrix #62

Workflow file for this run

name: cabal
on:
push:
branches: [main, ci-cabal]
pull_request:
branches: [main]
jobs:
build:
name: ghc-${{ matrix.vers.ghc }}
runs-on: ubuntu-latest
strategy:
matrix:
cabal: ["3.10.3.0"]
vers:
- {ghc: "9.2.8", stackage: "lts-20.26"}
- {ghc: "9.4.8", stackage: "lts-21.25"}
- {ghc: "9.6.5", stackage: "lts-22.22"}
- {ghc: "9.8.2", stackage: "nightly-2024-05-18"}
steps:
- uses: actions/checkout@v4
- name: Set up GHC and cabal-install
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.vers.ghc }}
cabal-version: ${{ matrix.cabal }}
enable-stack: true
stack-version: '2.15.7'
- name: Update hackage index
run: cabal update --ignore-project
- name: Install Dhall
uses: dhall-lang/setup-dhall@v4
with:
version: '1.42.0'
- name: Updo
run: GHC_VERSION=${{ matrix.vers.ghc }} STACKAGE_VERSION=${{ matrix.vers.stackage }} make -f project-files.mk cabal.project
- name: Build dry run
run: cabal build all --enable-tests --enable-benchmarks --dry-run
- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: cabal build all --only-dependencies
- name: Save cached dependencies
uses: actions/cache/save@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: build
run: cabal build all --enable-tests --enable-benchmarks
- name: test golden
run: cabal test test:golden --test-show-details=direct --test-option="--color=always"