heftia/.github/workflows/haskell.yml
2024-11-04 00:07:26 +09:00

48 lines
1.1 KiB
YAML

name: Haskell CI
on:
push:
pull_request:
types: [synchronize, opened, reopened]
schedule:
- cron: "0 0 * * 0"
permissions:
contents: read
jobs:
build:
strategy:
matrix:
ghc: ["9.4.1", "9.6.6", "9.8.2"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2.7.6
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "3.10"
- name: Cache
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies --enable-tests all
- name: Build
run: cabal build --enable-tests all
- name: Run tests
run: cabal test all