-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (99 loc) · 3.08 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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
ghc:
- '9.10.1'
- '9.8.2'
- '9.6.4'
- '9.4.8'
- '9.2.8'
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
- name: Configure the build and dry-run it
run: |
cabal configure --enable-tests --jobs --flags=pedantic
cabal build all --dry-run
- uses: actions/cache@v4
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ci-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/plan.json') }}
restore-keys: |
ci-${{ runner.os }}-${{ matrix.ghc }}-
- name: Test
run: cabal test
- name: Install
run: cabal install --overwrite-policy=always
- name: Run golden tests
env:
GOLDPLATE_TAGNAME: v0.2.1.1
run: |
case "$OSTYPE" in
linux* )
curl -L "https://github.com/fugue/goldplate/releases/download/${GOLDPLATE_TAGNAME}/goldplate-${GOLDPLATE_TAGNAME}-linux-x86_64.tar.gz" | tar xz -C . goldplate
;;
darwin* )
curl -L "https://github.com/fugue/goldplate/releases/download/${GOLDPLATE_TAGNAME}/goldplate-${GOLDPLATE_TAGNAME}-darwin-x86_64.tar.gz" | tar xz -C . goldplate
;;
esac
./goldplate --pretty-diff golden-test
cabal-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: '9.2.8'
- uses: actions/cache@v4
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: format-${{ runner.os }}-${{ steps.setup-haskell.outputs.ghc-version }}-${{ hashFiles('cabal.project') }}
restore-keys: |
format-${{ runner.os }}-${{ steps.setup-haskell.outputs.ghc-version }}-
- 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