Skip to content

Commit

Permalink
Add GitHub Actions CI
Browse files Browse the repository at this point in the history
Add GitHub Actions CI, with
  * job to test REUSE compliance
  * job to run "cabal test" and "cabal test --prefer-oldest"
  • Loading branch information
pgujjula committed Apr 4, 2024
1 parent eb89add commit 3179ee3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-FileCopyrightText: Copyright Preetham Gujjula
# SPDX-License-Identifier: BSD-3-Clause

name: CI
on:
- push
- pull_request
jobs:
generate-matrix:
name: Generate matrix from cabal
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
runs-on: ubuntu-latest
steps:
- name: Extract the tested GHC versions
id: set-matrix
uses: kleidukos/[email protected]
with:
cabal-file: apply-merge.cabal
ubuntu-version: latest
version: 0.1.7.0
reuse_compliance_check:
name: REUSE compliance check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v3
cabal_test:
name: cabal test - ghc-${{ matrix.ghc }}
needs: generate-matrix
runs-on: ubuntu-latest
continue-on-error: false
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
- name: Restore cache
uses: actions/cache@v4
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}
- name: Run cabal configure
run: cabal configure
--enable-tests
--test-show-details=streaming
- run: cabal update
- run: cabal freeze
- run: cabal test
- run: cabal test --prefer-oldest
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ SPDX-License-Identifier: CC-BY-SA-4.0

# apply-merge

[![CI](https://github.com/pgujjula/apply-merge/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/pgujjula/apply-merge/actions/workflows/ci.yml)

⚠️ Under construction. No stability guarantees, even commit history may be
overwritten.

0 comments on commit 3179ee3

Please sign in to comment.