Plutus constant support #17
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: covenant | |
on: | |
pull_request: | |
push: | |
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.1 | |
with: | |
cabal-file: covenant.cabal | |
ubuntu-version: "latest" | |
macos-version: "latest" | |
windows-version: "latest" | |
version: 0.1.7.1 | |
ormolu: | |
name: "Check formatting with Ormolu" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout base repo | |
uses: actions/checkout@v3 | |
- name: Run Ormolu | |
uses: haskell-actions/run-ormolu@v16 | |
with: | |
mode: "check" | |
hlint: | |
name: "Check with HLint" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout base repo | |
uses: actions/checkout@v3 | |
- name: Set up HLint | |
uses: haskell-actions/hlint-setup@v2 | |
- name: Run HLint | |
uses: haskell-actions/hlint-run@v2 | |
with: | |
path: src/ | |
fail-on: warning | |
cabal-gild: | |
name: "Check Cabal file with cabal-gild" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up environment | |
run: | | |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH | |
- name: Set up Haskell | |
id: setup-haskell | |
uses: haskell-actions/setup@v2 | |
with: | |
ghc-version: "9.8" | |
cabal-version: latest | |
- name: Check out cabal-gild | |
uses: actions/checkout@v3 | |
with: | |
repository: 'tfausak/cabal-gild' | |
ref: 'f30f35eadd68366b6e3087c060df83eef09be4b2' | |
- name: Freeze | |
run: cabal freeze | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
key: ${{ runner.os}}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | |
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- | |
- name: Install cabal-gild | |
run: cabal install | |
- name: Check out base repo | |
uses: actions/checkout@v3 | |
- name: Run cabal-gild | |
run: cabal-gild --input=covenant.cabal --mode=check | |
tests: | |
name: ${{ matrix.ghc }} on ${{ matrix.os }} | |
needs: [generate-matrix, ormolu, hlint, cabal-gild] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} | |
steps: | |
- name: Checkout base repo | |
uses: actions/checkout@v3 | |
- 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 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
key: ${{ runner.os}}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | |
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- | |
- name: Build | |
run: cabal build |