Skip to content

Update CI (#47)

Update CI (#47) #246

Workflow file for this run

name: build
on:
push:
pull_request:
branches: ["master"]
workflow_dispatch:
jobs:
build:
name: "build (os: ${{ matrix.os }}, ghc: ${{ matrix.ghc }}, cabal: ${{ matrix.cabal }}, llvm: ${{ matrix.llvm }})"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
ghc: ["9.4.8"]
cabal: ["3.8"]
llvm: ["16", "17", "18"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Haskell
uses: haskell-actions/setup@v2
id: setup-hs
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure the build
# The last step generates "dist-newstyle/cache/plan.json" for the cache key
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build all --dry-run
- name: Cache Cabal
uses: actions/cache@v4
env:
key-prefix: build-cache-cabal-os-${{ runner.os }}-ghc-${{ steps.setup-hs.outputs.ghc-version }}-cabal-${{ steps.setup-hs.outputs.cabal-version }}-llvm-${{ matrix.llvm }}
with:
path: ${{ steps.setup-hs.outputs.cabal-store }}
key: ${{ env.key-prefix }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key-prefix }}-
- name: Set up HLint
uses: haskell-actions/hlint-setup@v2
- name: Run HLint
uses: haskell-actions/hlint-run@v2
with:
fail-on: warning
- name: Check for Ormolu formatting
uses: haskell-actions/run-ormolu@v16
with:
pattern: |
app/**/*.hs
lib/**/*.hs
test/**/*.hs
- name: Install LLVM
run: sudo apt install -y llvm-${{ matrix.llvm }} llvm-${{ matrix.llvm }}-dev
- name: Build project
run: cabal build
- name: Run tests
run: >
cabal test
--test-show-details=direct
--test-options "--color=always"