-
Notifications
You must be signed in to change notification settings - Fork 10
130 lines (109 loc) · 3.3 KB
/
ci.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Run CI
on:
push:
branches: [ main ]
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- resolver: lts-18.28
ghc-version: 8.10.7
- resolver: lts-19.33
ghc-version: 9.0.2
- resolver: lts-20.26
ghc-version: 9.2.5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # If you only need the current version keep this.
- uses: ./.github/actions/setup-cache
with:
ghc-version: ${{ matrix.ghc-version }}
- uses: ./.github/actions/ci
with:
resolver: ${{ matrix.resolver }}
ghc-version: ${{ matrix.ghc-version }}
token: ${{ secrets.GITHUB_TOKEN }}
build-macosx:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- resolver: lts-18.28
ghc-version: 8.10.7
use-llvm: 'true'
- resolver: lts-19.33
ghc-version: 9.0.2
use-llvm: 'true'
- resolver: lts-20.26
ghc-version: 9.2.5
use-llvm: 'false'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # If you only need the current version keep this.
- name: Setup C_INCLUDE_PATH
run: |
brew install pcre
echo "C_INCLUDE_PATH=$(find /opt/homebrew/Cellar/pcre -name 'pcre.h' -exec dirname {} \;):$(xcrun --show-sdk-path)/usr/include/ffi" >> $GITHUB_ENV
- name: Add LLVM to path
if: ${{ matrix.use-llvm == 'true' }}
run: |
brew install llvm@14
echo "PATH=/opt/homebrew/opt/llvm@14/bin:$PATH" >> $GITHUB_ENV
- uses: ./.github/actions/setup-cache
with:
ghc-version: ${{ matrix.ghc-version }}
- uses: ./.github/actions/ci
with:
resolver: ${{ matrix.resolver }}
ghc-version: ${{ matrix.ghc-version }}
token: ${{ secrets.GITHUB_TOKEN }}
quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # If you only need the current version keep this.
- uses: ./.github/actions/setup-cache
with:
ghc-version: '9.4.7'
- uses: haskell-actions/setup@v2
with:
ghc-version: '9.4.7'
- name: 'Set up HLint'
uses: haskell-actions/hlint-setup@v2
with:
version: 3.5
- name: 'Run HLint'
uses: haskell-actions/hlint-run@v2
with:
fail-on: warning
- uses: haskell-actions/run-fourmolu@v10
with:
version: "0.10.1.0"
pattern: |
src
test
- name: Install hpack
run: cabal install --global hpack-0.35.1
- name: Verify the generated .cabal file is up-to-date
run: |
hpack
if [ $(git status --porcelain | wc -l) -gt 0 ]; then
echo "hpack resulted in modified files. please run hpack locally and commit those changes"
echo ""
echo "showing the results of `git status`"
git status
exit -1
fi