-
Notifications
You must be signed in to change notification settings - Fork 12
81 lines (66 loc) · 2.17 KB
/
build.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
76
77
78
79
80
81
name: build
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request:
branches:
- main
schedule:
- cron: 0 0 * * *
jobs:
build:
name: ${{ matrix.os }} / GHC ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
ghc:
- '9.2'
- '9.4'
- '9.6'
include:
- os: macos-latest
ghc: system
steps:
- uses: actions/checkout@v3
- uses: hspec/setup-haskell@v1
with:
ghc-version: ${{ matrix.ghc }}
id: setup-haskell
- uses: actions/cache@v3
with:
path: ${{ runner.os == 'Windows' && 'C:/cabal/store/' || runner.os == 'macOS' && '~/.cabal/store/' || '~/.local/state/cabal/store/' }}
key: ${{ runner.os }}-${{ steps.setup-haskell.outputs.ghc-version }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-${{ steps.setup-haskell.outputs.ghc-version }}-
- shell: bash
# The macOS runner comes with an outdated version of cabal:
# https://github.com/actions/runner-images/blob/macOS-12/20230416.1/images/macos/macos-12-Readme.md#tools
#
# (on Linux this is a noop)
run: ghcup install cabal 3.10 --set
- shell: bash
run: git config --global init.defaultBranch main
- shell: bash
run: cabal update
- shell: bash
run: cabal configure --enable-tests --enable-benchmarks
- shell: bash
run: cabal build all
- shell: bash
run: echo | cabal repl sensei --build-depends hspec-meta
- shell: bash
run: cabal exec -- "${PWD}/$(find dist-newstyle/ -name spec -type f)" --times --print-slow
env:
HSPEC_OPTIONS: --color
success:
needs: build
runs-on: ubuntu-latest
if: always() # this is required as GitHub considers "skipped" jobs as "passed" when checking branch protection rules
steps:
- run: false
if: needs.build.result != 'success'
- uses: actions/checkout@v3
- name: Check for trailing whitespace
run: '! git grep -I "\s\+$"'