Skip to content

Commit

Permalink
Matrix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
HuwCampbell committed Oct 1, 2024
1 parent f04a741 commit ff23d57
Showing 1 changed file with 31 additions and 24 deletions.
55 changes: 31 additions & 24 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,41 @@ permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- cabal: "3.8.1"
ghc: "8.8.4"
os: ubuntu-latest
- cabal: "3.8.1"
ghc: "8.10.7"
os: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-haskell@v1
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: '8.10.3'
cabal-version: '3.2'
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- name: Cache
uses: actions/cache@v3
env:
cache-name: cache-cabal
- name: Freeze
run: |
cabal configure
cabal freeze
- uses: actions/cache@v1
name: Cache ~/.cabal/store
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal test all
run: |
cabal build
- name: Test
run: |
cabal test

0 comments on commit ff23d57

Please sign in to comment.