Skip to content

Commit

Permalink
init CI
Browse files Browse the repository at this point in the history
  • Loading branch information
t-lohse committed Dec 30, 2023
1 parent f65e29f commit e1c32a5
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Release"

on:
workflow_run:
workflows: ["Haskell CI"]
types:
- completed
workflow_dispatch:

jobs:
release:
name: "Release"
runs-on: "ubuntu-latest"
steps:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: ${{ github.event_name == 'pull_request' }}
title: "Development Build"
files: *.pdf

50 changes: 50 additions & 0 deletions .github/workflows/haskell_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Haskell CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-haskell@v1
with:
ghc-version: '8.10.3'
cabal-version: '3.2'

- 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 install hlint
cabal build --only-dependencies --enable-tests --enable-benchmarks
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Fmt
run: |
hlint app
hlint src
hlint test
- name: Run tests
run: cabal test all

0 comments on commit e1c32a5

Please sign in to comment.