-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (116 loc) · 3.51 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
ghc:
- '9.8.2'
- '9.6.4'
- '9.4.8'
- '9.2.8'
cabal:
- '3.10.1.0'
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Freeze dependencies
run: cabal freeze
- uses: actions/cache@v4
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ci-${{ runner.os }}-${{ matrix.cabal }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
ci-${{ runner.os }}-${{ matrix.cabal }}-${{ matrix.ghc }}-
- name: Add path
run: |
mkdir -p ~/bin
echo ~/bin >> "$GITHUB_PATH"
- name: Install goldplate
run: |
case "$OSTYPE" in
linux* )
curl -L https://github.com/fugue/goldplate/releases/download/v0.2.1/goldplate-v0.2.1-linux-x86_64.tar.gz | tar xz -C ~/bin
;;
darwin* )
curl -L https://github.com/fugue/goldplate/releases/download/v0.2.1/goldplate-v0.2.1-darwin-x86_64.tar.gz | tar xz -C ~/bin
;;
esac
- name: Configure
run: |
rm cabal.project.freeze
cabal configure --jobs --flags=pedantic
- name: Build
run: cabal install --overwrite-policy=always
- name: Configure for Test
run: |
rm -fv cabal.project.local
cabal configure --enable-tests --jobs --flags=pedantic
- name: Run tests
run: cabal test
- name: Run golden tests
run: goldplate --pretty-diff golden-test
cabal-format:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
ghc: ['9.2.8']
cabal: ['3.10.1.0']
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache@v4
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: format-${{ runner.os }}-${{ matrix.cabal }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project') }}
restore-keys: |
format-${{ runner.os }}-${{ matrix.cabal }}-${{ matrix.ghc }}-
- name: Install cabal-fmt
run: cabal install --overwrite-policy=always -j cabal-fmt
- name: Run cabal-fmt
run: cabal-fmt --check --Werror haskellorls.cabal
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ormolu
uses: mrkkrp/ormolu-action@v15
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/hlint-setup@v2
with:
version: '3.6.1'
- name: Run hlint
uses: haskell-actions/hlint-run@v2
with:
fail-on: status
path: '["app/", "src/", "test/"]'
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run actionlint
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color