-
Notifications
You must be signed in to change notification settings - Fork 0
272 lines (234 loc) · 7.69 KB
/
integration.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
name: Continuous Integration
on:
push:
branches:
- "*"
paths-ignore:
- "*.md"
tags-ignore:
- "*"
pull_request:
concurrency:
group: ${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
HEX_HTTP_TIMEOUT: 120
jobs:
format:
name: Check formatting
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Set up Erlang and Elixir
id: beam
uses: erlef/setup-beam@v1
with:
version-type: "strict"
version-file: ".tool-versions"
install-hex: true
install-rebar: true
- name: Restore formatting environment
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-format
path: |
deps/
_build/dev/
- name: Fetch the dependencies
run: mix deps.get
- name: Format code
run: mix format --check-formatted
credo:
name: Run Credo
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Set up Erlang and Elixir
id: beam
uses: erlef/setup-beam@v1
with:
version-type: "strict"
version-file: ".tool-versions"
install-hex: true
install-rebar: true
- name: Restore Credo environment
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-credo
path: |
deps/
_build/dev/
- name: Fetch the dependencies
run: mix deps.get
- name: Run credo
run: mix credo --format sarif
dialyxir:
name: Run Dialyxir
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Set up Erlang and Elixir
id: beam
uses: erlef/setup-beam@v1
with:
version-type: "strict"
version-file: ".tool-versions"
install-hex: true
install-rebar: true
- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-dialyxir-${{ hashFiles('mix.lock') }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-dialyxir-
path: |
deps/
_build/dev/
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: |
mix deps.get
mix dialyzer --plt
- name: Save PLT cache
uses: actions/cache/save@v3
if: steps.plt_cache.outputs.cache-hit != 'true'
with:
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-dialyxir-${{ hashFiles('mix.lock') }}
path: |
deps/
_build/dev/
- name: Run dialyzer
run: mix dialyzer --format github
test:
name: Run tests
runs-on: ubuntu-22.04
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
include:
# Elixir 1.16.2 / Elasticsearch 8.13.0
- elixir: "1.16.2"
erlang: "26.2.3"
elasticsearch: "8.13.0"
- elixir: "1.16.2"
erlang: "25.3.2.10"
elasticsearch: "8.13.0"
- elixir: "1.16.2"
erlang: "24.3.4.16"
elasticsearch: "8.13.0"
# Elixir 1.16.2 / Elasticsearch 7.17.16
# - elixir: "1.16.2"
# erlang: "26.2.3"
# elasticsearch: "7.17.16"
# - elixir: "1.16.2"
# erlang: "25.3.2.10"
# elasticsearch: "7.17.16"
# - elixir: "1.16.2"
# erlang: "24.3.4.16"
# elasticsearch: "7.17.16"
# Elixir 1.15.7 / Elasticsearch 8.13.0
- elixir: "1.15.7"
erlang: "26.2.3"
elasticsearch: "8.13.0"
- elixir: "1.15.7"
erlang: "25.3.2.10"
elasticsearch: "8.13.0"
- elixir: "1.15.7"
erlang: "24.3.4.16"
elasticsearch: "8.13.0"
# Elixir 1.15.7 / Elasticsearch 7.17.16
# - elixir: "1.15.7"
# erlang: "26.2.3"
# elasticsearch: "7.17.16"
# - elixir: "1.15.7"
# erlang: "25.3.2.10"
# elasticsearch: "7.17.16"
# - elixir: "1.15.7"
# erlang: "24.3.4.16"
# elasticsearch: "7.17.16"
# Elixir 1.14.5 / Elasticsearch 8.13.0
- elixir: "1.14.5"
erlang: "26.2.3"
elasticsearch: "8.13.0"
- elixir: "1.14.5"
erlang: "25.3.2.10"
elasticsearch: "8.13.0"
- elixir: "1.14.5"
erlang: "24.3.4.16"
elasticsearch: "8.13.0"
# Elixir 1.14.5 / Elasticsearch 7.17.16
# - elixir: "1.14.5"
# erlang: "26.2.3"
# elasticsearch: "7.17.16"
# - elixir: "1.14.5"
# erlang: "25.3.2.10"
# elasticsearch: "7.17.16"
# - elixir: "1.14.5"
# erlang: "24.3.4.16"
# elasticsearch: "7.17.16"
# Elixir 1.13.4 / Elasticsearch 8.13.0
- elixir: "1.13.4"
erlang: "25.3.2.10"
elasticsearch: "8.13.0"
- elixir: "1.13.4"
erlang: "24.3.4.16"
elasticsearch: "8.13.0"
# Elixir 1.13.4 / Elasticsearch 7.17.16
# - elixir: "1.13.4"
# erlang: "25.3.2.10"
# elasticsearch: "7.17.16"
# - elixir: "1.13.4"
# erlang: "24.3.4.16"
# elasticsearch: "7.17.16"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch }}
ports: ["9200:9200"]
env:
discovery.type: "single-node"
ELASTIC_PASSWORD: "elastic"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Set up Erlang and Elixir
id: beam
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang }}
elixir-version: ${{ matrix.elixir }}
install-hex: true
install-rebar: true
- name: Restore formatting environment
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-elasticsearch-${{ matrix.elasticsearch }}-test
path: |
deps/
_build/test/
- name: Fetch the dependencies
run: mix deps.get
- name: Compile the project
env:
MIX_ENV: test
run: mix compile
- name: Wait for Elasticsearch
run: |
until $(curl --output /dev/null --silent --head --fail --insecure --user "elastic:elastic" "https://localhost:9200"); do
printf '.'
sleep 1
done
result=$(curl --silent --insecure --user "elastic:elastic" "https://localhost:9200/_cluster/health?wait_for_status=green&timeout=50s")
if [[ "$(cat $result | jq -r .timed_out)" = "true" ]]; then
echo "Elasticsearch is not ready"
exit 1
fi
- name: Run tests
run: mix test