-
Notifications
You must be signed in to change notification settings - Fork 10
75 lines (63 loc) · 1.92 KB
/
haskell.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# NOTE: This should be a good reference for github actions w.r.t haskell
# https://markkarpov.com/post/github-actions-for-haskell-ci.html
name: kriti-lang::CI
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- synchronize
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mrkkrp/ormolu-action@v4
with:
respect-cabal-files: false
build-test:
runs-on: ubuntu-latest
# NOTE: once the library is ready to be released into the wild
# we could use this code block to run the tests and build the exe.
# on multiple GHC versions and perhaps even multiple cabal versions
strategy:
matrix:
cabal: ["3.6.2"]
ghc: ["8.10.7", "9.0.2", "9.2.4"]
env:
CONFIG: "--project-file=ci/${{ matrix.ghc }}.project"
steps:
- name: "Checkout"
uses: actions/[email protected]
- name: "Setup"
uses: haskell/actions/[email protected]
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: "Install Happy/Alex"
run: sudo apt-get install happy alex
- name: "Cache"
uses: actions/[email protected]
env:
cache-name: cache-cabal
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
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: "Build"
run: cabal build $CONFIG
- name: "Test"
run: cabal test $CONFIG
# NOTE: keeping these here for future versions
# - run: cabal haddock $CONFIG
# - run: cabal sdist