Build with Cabal #451
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: Build with Cabal | |
on: | |
workflow_dispatch: | |
push: | |
schedule: | |
- cron: '0 8 * * *' | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ['9.0', '9.2', '9.4', '9.6', '9.8'] | |
cabal: ['3.10'] | |
os: ['ubuntu-22.04', 'ubuntu-20.04', 'macOS-latest'] | |
steps: | |
# Setup | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install GHC and Cabal | |
uses: haskell/actions/setup@v2 | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
- name: Configure project | |
run: | | |
cat > cabal.project.local <<EOF | |
package merkle-log | |
documentation: True | |
benchmarks: True | |
tests: True | |
EOF | |
# Restore Packages from Caches | |
- uses: actions/cache@v3 | |
name: Cache dist-newstyle | |
with: | |
path: | | |
~/.cabal/packages | |
~/.cabal/store | |
dist-newstyle | |
key: ${{ matrix.os }}-${{ matrix.ghc }}-cabal | |
# Build | |
- name: Update package database | |
run: cabal update | |
- name: Configure build | |
run: | | |
cabal build all --dry-run | |
cabal freeze | |
- name: Install build dependencies | |
run: cabal build --only-dependencies | |
- name: Build library | |
run: cabal build | |
# Tests | |
- name: Run Tests | |
run: cabal test |