Skip to content

chore: Update GH workflow to use get-tested #52

chore: Update GH workflow to use get-tested

chore: Update GH workflow to use get-tested #52

Workflow file for this run

name: Build and Test
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
jobs:

Check failure on line 18 in .github/workflows/build-and-test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-and-test.yml

Invalid workflow file

You have an error in your yaml syntax on line 18
generate-matrix:
name: "Generate matrix from cabal"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
runs-on: ubuntu-latest
steps:
- name: Extract the tested GHC versions
id: set-matrix
uses: kleidukos/get-tested@v0.1.7.0
with:
cabal-file: get-tested.cabal
ubuntu-version: "latest"
macos-version: "13"
version: 0.1.7.0
build-and-test:
name: ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generate-matrix
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Haskell
id: setup-haskell-cabal
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "3.8"
- name: Update cabal
run: cabal update
- name: Freeze dependencies
run: cabal freeze --enable-tests
- name: Cache dependencies and dist-newstyle
uses: actions/cache@v2
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: dependencies-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
dependencies-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
dependencies-${{ runner.os }}-${{ matrix.ghc }}-
- name: Install dependencies
run: cabal install --only-dependencies
- name: Build project
run: cabal build --enable-tests
- name: Run tests
run: cabal test --enable-tests