Skip to content

Extensible diff types #19

Extensible diff types

Extensible diff types #19

Workflow file for this run

name: Haskell CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [ opened, synchronize, reopened, ready_for_review ]
permissions:
contents: read
jobs:
generate-matrix:
name: "Generate matrix from cabal"
if: ( ( github.event_name == 'push' )
|| ( github.event_name == 'pull_request'
&& github.event.pull_request.draft == false
)
)
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.1
with:
cabal-file: generic-diff.cabal
ubuntu-version: "latest"
version: 0.1.7.1
test:
if: ( ( github.event_name == 'push' )
|| ( github.event_name == 'pull_request'
&& github.event.pull_request.draft == false
)
)
name: ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generate-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2.7
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.0'
- name: Cache
uses: actions/cache@v3
env:
cache-name: cache-cabal
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 }}-
- 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