Skip to content

Updating CI to new get-tested version (v0.1.7.0) #109

Updating CI to new get-tested version (v0.1.7.0)

Updating CI to new get-tested version (v0.1.7.0) #109

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
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: dotenv.cabal
ubuntu-version: latest
macos-version: 14
version: 0.1.7.0
build-and-test:
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generate-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Setup Haskell
id: setup-haskell-cabal
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "3.8"
- name: Update dependencies with Hackage
run: cabal update
- name: Build dependencies
run: cabal freeze --enable-tests
- name: Cache dependencies and dist-newstyle
uses: actions/cache@v3
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