-
-
Notifications
You must be signed in to change notification settings - Fork 54
255 lines (215 loc) · 7.35 KB
/
main.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
name: CI
on:
pull_request:
push:
branches:
- main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MIX_ENV: test
jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
strategy:
fail-fast: true
steps:
- name: Clone the repository
uses: actions/checkout@v3
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: "25.3"
elixir-version: "1.15.4"
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: |
deps
_build
key: |
${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-
- name: Install and compile dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: mix do deps.get + deps.compile
- name: Check formatting
run: mix format --check-formatted
- name: Check no unused dependencies
run: mix deps.unlock --check-unused
if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
- name: Compile with --warnings-as-errors
run: mix compile --warnings-as-errors --force
- name: Cache Dialyzer's PLT
uses: actions/cache@v3
id: cache-plt
with:
path: priv/plts
key: |
${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-
# Create PLTs if no cache was found
- name: Create PLTs
if: steps.cache-plt.outputs.cache-hit != 'true'
run: mix dialyzer --plt
- name: Run Dialyzer
run: mix dialyzer --format github
test:
name: >-
Test (
Elixir ${{ matrix.elixir }},
OTP ${{ matrix.otp }},
C* ${{ matrix.server_versions.cassandra }},
Scylla ${{ matrix.server_versions.scylla }},
Native protocol ${{ matrix.cassandra_native_protocol }}
)
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
otp:
- "25.3"
elixir:
- "1.15.4"
server_versions:
- cassandra: "4.1"
scylla: "5.1.6"
- cassandra: "3"
scylla: "4.6.3"
cassandra_native_protocol:
- "v3"
- "v4"
include:
# Only C* 4.1+ supports native protocol v5.
- otp: "25.3"
elixir: "1.15.4"
test_only_cassandra: true
cassandra_version: "4.1"
cassandra_native_protocol: "v4"
# Oldest supported Elixir/OTP matrix. We support down to Erlang 21, but
# rustler_precompiled (which we use for nimble_lz4, which we use for testing)
# requires OTP 23+.
- otp: "23.3"
elixir: "1.11"
test_only_cassandra: true
cassandra_version: "3"
cassandra_native_protocol: "v3"
env:
CASSANDRA_VERSION: ${{ matrix.server_versions.cassandra }}
SCYLLA_VERSION: ${{ matrix.server_versions.scylla }}
CASSANDRA_NATIVE_PROTOCOL: ${{ matrix.cassandra_native_protocol }}
LOG_LEVEL: debug
XANDRA_DEBUG: true
steps:
- name: Clone the repository
uses: actions/checkout@v3
- name: Start Docker and wait for it to be up
run: |
docker-compose up --detach --build
./test/docker/health-check-services.sh
- name: Install Python (for ccm)
uses: actions/setup-python@v4
with:
python-version: "3.9.16"
- name: Install ccm
run: pip3 install ccm
- name: Install OpenJDK
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: |
deps
_build
key: |
${{ runner.os }}-mix-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
restore-keys:
${{ runner.os }}-mix-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-
- name: Install and compile dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: mix do deps.get --only test, deps.compile
# TODO: eventually figure out why we can't run encryption tests on CI.
- name: Run tests for Cassandra and Scylla
if: ${{ !matrix.test_only_cassandra }}
run: mix test.all --trace --exclude encryption --exclude ccm
- name: Run tests for Cassandra only
if: ${{ matrix.test_only_cassandra }}
run: mix test --trace --exclude encryption --exclude ccm
- name: Dump Docker logs on failure
uses: jwalton/gh-docker-logs@v1
if: failure()
test_clustering:
name: Test C* Clustering (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }}, C* ${{ matrix.cassandra_version }}, Native protocol ${{ matrix.cassandra_native_protocol }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- otp: "24.2"
elixir: "1.13"
cassandra_version: "4.1"
cassandra_native_protocol: "v5"
- otp: "24.2"
elixir: "1.13"
cassandra_version: "4.1"
cassandra_native_protocol: "v4"
- otp: "24.2"
elixir: "1.13"
cassandra_version: "3"
cassandra_native_protocol: "v3"
- otp: "24.2"
elixir: "1.13"
cassandra_version: "3"
cassandra_native_protocol: "v4"
# Oldest supported Elixir/OTP matrix. We support down to Erlang 21, but
# rustler_precompiled (which we use for nimble_lz4, which we use for testing)
# requires OTP 23+.
- otp: "23.3"
elixir: "1.11"
cassandra_version: "3"
cassandra_native_protocol: "v3"
env:
CASSANDRA_VERSION: ${{ matrix.cassandra_version }}
CASSANDRA_NATIVE_PROTOCOL: ${{ matrix.cassandra_native_protocol }}
steps:
- name: Clone the repository
uses: actions/checkout@v2
- name: Start Docker and wait for it to be up
run: |
docker-compose up --detach --build
./test/docker/health-check-services.sh
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
- name: Install and compile dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
mix deps.get --only test
mix deps.compile
- name: Run clustering end-to-end tests
run: mix test.clustering
- name: Dump Docker logs on failure
uses: jwalton/gh-docker-logs@v1
if: failure()