Skip to content

CI

CI #40

Workflow file for this run

name: Build
on:
push:
branches: [ "main" ]
paths: [ "src/**", "test/**", "app/**", "package.yaml", "stack.yaml", "stack.yaml.lock", "UniHs.cabal", "Setup.hs" ]
# pull_request:
# branches: [ "main" ]
workflow_dispatch:
# inputs:
permissions:
contents: read
jobs:
build:
name: GHC ${{ matrix.ghc-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
ghc-version: ['9.6.3']
steps:
- uses: actions/checkout@v3
- name: Set up GHC ${{ matrix.ghc-version }}
uses: haskell/actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc-version }}
enable-stack: true
stack-version: 'latest'
- name: Restore cached dependencies
uses: actions/cache/restore@v3
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-stack-${{ steps.setup.outputs.stack-version }}
with:
path: |
~/.stack
.stack-work
key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml.lock', 'package.yaml') }}
restore-keys: |
${{ runner.os }}-stack
- name: Install dependencies
run: stack build --only-dependencies
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
- name: Save cached dependencies
uses: actions/cache/save@v3
# Caches are immutable, trying to save with the same key would error.
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.stack-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Build
run: stack build
# - name: Run tests
# run: cabal test all
# - name: Check cabal file
# run: cabal check
# - name: Build documentation
# run: cabal haddock all