Skip to content

Commit

Permalink
Add GitHub CI
Browse files Browse the repository at this point in the history
(based on Lamdu's CI)

Original hope was to repro the CI failure for updating git-mediate in homebrew,
see https://github.com/Peaker/git-mediate/actions/runs/10963827753/job/30446115463?pr=53

But it appears that stack isn't really a reprodicible build and the linux build error
in homebrew's CI doesn't reproduce.

Still doesn't hurt to have a CI so pushing anyhow.
  • Loading branch information
yairchu committed Sep 20, 2024
1 parent 2ebf154 commit c628ed1
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 c628ed1

Please sign in to comment.