Skip to content

Commit

Permalink
Add GitHub CI
Browse files Browse the repository at this point in the history
(based on Lamdu's CI)
  • Loading branch information
yairchu committed Sep 20, 2024
1 parent 2ebf154 commit 15016d8
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
workflow_dispatch:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [main]
schedule:
# additionally run once per week (At 00:00 on Sunday) to maintain cache
- cron: '0 0 * * 0'

jobs:
stack:
name: ghc ${{ matrix.ghc }} / ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
stack: ["3.1.1"]
ghc: ["9.6.6"]
os: ["ubuntu-latest"]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: haskell/actions/[email protected]
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}

- uses: actions/[email protected]
if: ${{ matrix.os == 'ubuntu-latest' }}
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack

- name: Install Haskell dependencies
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
- name: Build
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
- name: Test
# Running the tests only on Linux should suffice
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
stack test --system-ghc

0 comments on commit 15016d8

Please sign in to comment.