Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions CI #37

Merged
merged 2 commits into from
Mar 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: "actions/checkout@v1"
- id: setup-haskell-cabal
uses: "haskell/actions/[email protected]"
with:
cabal-version: "${{ matrix.cabal }}"
enable-stack: false
ghc-version: "${{ matrix.ghc }}"
- uses: "actions/cache@v1"
with:
key: "${{ runner.os }}-${{ matrix.ghc }}-cabal"
path: "${{ steps.setup-haskell-cabal.outputs.cabal-store }}"
- name: Install dependencies
run: |
cabal update
cabal build --enable-tests --enable-benchmarks --only-dependencies
- name: build
run: cabal build --enable-tests --enable-benchmarks
- name: test
run: cabal test --enable-tests
strategy:
matrix:
cabal:
- '3.2'
ghc:
- '8.10.4'
- '8.8.4'
- '8.6.5'
- '9.0.1'
name: Haskell CI
on:
- push
- pull_request
30 changes: 30 additions & 0 deletions ci.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
let haskellCi =
https://raw.githubusercontent.com/sorki/github-actions-dhall/pending/haskell-ci.dhall

let Prelude = https://prelude.dhall-lang.org/package.dhall

let matrixStepsNoHaddoc =
let steps = haskellCi.matrixSteps

in Prelude.List.take
( Prelude.Natural.subtract
1
(Prelude.List.length haskellCi.BuildStep steps)
)
haskellCi.BuildStep
steps

in haskellCi.generalCi
matrixStepsNoHaddoc
( Some
{ ghc =
[ haskellCi.GHC.GHC8104
, haskellCi.GHC.GHC884
, haskellCi.GHC.GHC865
, haskellCi.GHC.GHC901
]
, cabal = [ haskellCi.Cabal.Cabal32 ]
}
)
// { on = [ haskellCi.Event.push, haskellCi.Event.pull_request ] }
: haskellCi.CI.Type
11 changes: 11 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Script by @fisx

set -eo pipefail
cd "$( dirname "${BASH_SOURCE[0]}" )"

echo "regenerating .github/workflows/ci.yaml..."

# based on https://github.com/vmchale/github-actions-dhall
which dhall-to-yaml || cabal install dhall-yaml
dhall-to-yaml --file ci.dhall > .github/workflows/ci.yaml