Skip to content

Build with Cabal

Build with Cabal #460

Workflow file for this run

name: Build with Cabal
on:
push:
workflow_dispatch:
schedule:
- cron: '0 9 * * *'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['8.10', '9.0', '9.2', '9.4', '9.6']
cabal: ['3.10']
os: ['ubuntu-20.04', 'ubuntu-22.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 digraph
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 }}-0-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