Use diff-package-api Workflow #280
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Trigger the workflow on push or pull request, but only for the main branch | |
on: | |
pull_request: | |
push: | |
branches: ["main"] | |
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/[email protected] | |
with: | |
cabal-file: text-display.cabal | |
ubuntu-version: "latest" | |
macos: "macos-13" | |
version: 0.1.7.0 | |
tests: | |
name: ${{ matrix.ghc }} on ${{ matrix.os }} | |
needs: generate-matrix | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} | |
steps: | |
- name: Checkout base repo | |
uses: actions/checkout@v4 | |
- name: Set up Haskell | |
id: setup-haskell | |
uses: haskell-actions/setup@v2 | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: 'latest' | |
- name: Freeze | |
run: cabal freeze --project-file=cabal.ci.project | |
- name: Cache | |
uses: actions/[email protected] | |
with: | |
path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ runner.os }}-ghc-${{ matrix.ghc }}- | |
- name: Setup mdBook | |
uses: peaceiris/actions-mdbook@v2 | |
with: | |
mdbook-version: '0.4.40' | |
- run: make docs | |
- name: Build | |
run: cabal build --project-file=cabal.ci.project --write-ghc-environment-files=always | |
- name: Test | |
run: cabal test --project-file=cabla.ci.project all | |
- name: API Golden tests | |
uses: kleidukos/[email protected] | |
with: | |
package-name: text-display | |
expected-interface: test/package-api.txt | |
ghc: ${{ matrix.ghc }} | |
version: 0.1.0.0 |