Skip to content

Commit fd2fdac

Browse files
committed
Add Actions CI
1 parent 87fb6c4 commit fd2fdac

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
jobs:
2+
build:
3+
runs-on: ubuntu-latest
4+
steps:
5+
- name: Native dependencies
6+
run: sudo apt install libgmp-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev
7+
- uses: "actions/checkout@v3"
8+
- id: setup-haskell-cabal
9+
uses: "haskell/actions/setup@v2"
10+
with:
11+
cabal-version: "${{ matrix.cabal }}"
12+
enable-stack: false
13+
ghc-version: "${{ matrix.ghc }}"
14+
- name: Update Hackage repository
15+
run: cabal update
16+
- name: cabal.project.local.ci
17+
run: |
18+
if [ -e cabal.project.local.ci ]; then
19+
cp cabal.project.local.ci cabal.project.local
20+
fi
21+
- name: freeze
22+
run: cabal freeze
23+
- uses: "actions/cache@v3"
24+
with:
25+
key: "${{ runner.os }}-${{ matrix.ghc }}-cabal-${{ hashFiles('cabal.project.freeze') }}"
26+
path: |
27+
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
28+
dist-newstyle
29+
- name: Install dependencies
30+
run: cabal build all --enable-tests --enable-benchmarks --only-dependencies
31+
- name: build all
32+
run: cabal build all --enable-tests --enable-benchmarks
33+
- name: test all
34+
run: cabal test all --enable-tests
35+
- name: haddock all
36+
run: cabal haddock all
37+
strategy:
38+
matrix:
39+
cabal:
40+
- '3.4'
41+
ghc:
42+
- '9.0.2'
43+
- '8.10.7'
44+
name: Haskell CI
45+
on:
46+
- push
47+
- pull_request

ci.dhall

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
let haskellCi =
2+
https://raw.githubusercontent.com/sorki/github-actions-dhall/pending/haskell-ci.dhall
3+
4+
in haskellCi.generalCi
5+
( [ haskellCi.BuildStep.Name
6+
{ name = "Native dependencies"
7+
, run =
8+
"sudo apt install libgmp-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev"
9+
}
10+
]
11+
# haskellCi.matrixSteps
12+
)
13+
( Some
14+
{ ghc = [ haskellCi.GHC.GHC902, haskellCi.GHC.GHC8107 ]
15+
, cabal = [ haskellCi.Cabal.Cabal34 ]
16+
}
17+
)
18+
: haskellCi.CI.Type

ci.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
# Script by @fisx
3+
4+
set -eo pipefail
5+
cd "$( dirname "${BASH_SOURCE[0]}" )"
6+
7+
echo "regenerating .github/workflows/ci.yaml..."
8+
9+
mkdir -p .github/workflows
10+
11+
# based on https://github.com/vmchale/github-actions-dhall
12+
which dhall-to-yaml || cabal install dhall-yaml
13+
dhall-to-yaml --file ci.dhall > .github/workflows/ci.yaml

0 commit comments

Comments
 (0)