28
28
java-version : ${{ matrix.java-version }}
29
29
distribution : ' adopt'
30
30
31
+ - name : Get POM hash
32
+ id : get-pom-hash
33
+ run : echo "value=${{ hashFiles('**/pom.xml') }}" >> "$GITHUB_OUTPUT"
34
+
35
+ - name : Restore maven repository cache
36
+ uses : actions/cache/restore@v4
37
+ id : java-cache
38
+ with :
39
+ path : ~/.m2/repository
40
+ key : ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ steps.get-pom-hash.outputs.value }}
41
+
31
42
- name : Compile source and tests
32
43
run : mvn -B compile test-compile -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
33
44
45
+ - name : Download test dependencies
46
+ if : steps.java-cache.outputs.cache-hit != 'true'
47
+ run : mvn -B test -Dtest=TestThatDoesNotExists -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true || true
48
+
49
+ - name : Download verify dependencies
50
+ if : steps.java-cache.outputs.cache-hit != 'true'
51
+ run : mvn -B verify -DskipTests || true
52
+
53
+ - name : Save maven repository cache
54
+ uses : actions/cache/save@v4
55
+ if : steps.java-cache.outputs.cache-hit != 'true'
56
+ with :
57
+ path : ~/.m2/repository
58
+ key : ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ steps.get-pom-hash.outputs.value }}
59
+
34
60
verify :
35
61
name : Full verify
36
62
runs-on : ubuntu-latest
51
77
java-version : ${{ matrix.java-version }}
52
78
distribution : ' adopt'
53
79
80
+ - name : Restore maven repository cache
81
+ uses : actions/cache/restore@v4
82
+ with :
83
+ path : ~/.m2/repository
84
+ key : ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
85
+
54
86
- name : Full verify
55
87
run : mvn -B verify -DskipTests
56
88
@@ -60,16 +92,27 @@ jobs:
60
92
runs-on : ubuntu-latest
61
93
timeout-minutes : 10
62
94
95
+ strategy :
96
+ matrix :
97
+ java-version : [8]
98
+ fail-fast : false
99
+
63
100
steps :
64
101
- name : Checkout source
65
102
uses : actions/checkout@v2
66
103
67
104
- name : Set up JDK 8
68
105
uses : actions/setup-java@v2
69
106
with :
70
- java-version : ' 8 '
107
+ java-version : ${{ matrix.java-version }}
71
108
distribution : ' adopt'
72
109
110
+ - name : Restore maven repository cache
111
+ uses : actions/cache/restore@v4
112
+ with :
113
+ path : ~/.m2/repository
114
+ key : ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
115
+
73
116
- name : Run unit tests
74
117
run : mvn -B test -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
75
118
79
122
shopt -s globstar
80
123
mkdir unit
81
124
cp --parents ./**/target/*-reports/*.xml unit/
125
+
82
126
- name : Upload test results
83
127
uses : actions/upload-artifact@v2
84
128
if : success() || failure()
@@ -119,6 +163,7 @@ jobs:
119
163
strategy :
120
164
matrix :
121
165
cassandra-version : ${{ fromJson(needs.setup-integration-tests.outputs.cassandra-integration-tests-versions) }}
166
+ java-version : [8]
122
167
fail-fast : false
123
168
124
169
steps :
@@ -128,9 +173,15 @@ jobs:
128
173
- name : Set up JDK 8
129
174
uses : actions/setup-java@v2
130
175
with :
131
- java-version : ' 8 '
176
+ java-version : ${{ matrix.java-version }}
132
177
distribution : ' adopt'
133
178
179
+ - name : Restore maven repository cache
180
+ uses : actions/cache/restore@v4
181
+ with :
182
+ path : ~/.m2/repository
183
+ key : ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
184
+
134
185
- name : Setup Python 3
135
186
uses : actions/setup-python@v2
136
187
with :
@@ -139,15 +190,31 @@ jobs:
139
190
- name : Setup environment
140
191
run : |
141
192
pip3 install https://github.com/scylladb/scylla-ccm/archive/a93125bc6ad7dd5c9694331e89dc1fb212431ffe.zip
193
+
194
+ - name : Restore CCM image cache
195
+ uses : actions/cache/restore@v4
196
+ id : ccm-cache
197
+ with :
198
+ path : ~/.ccm/repository
199
+ key : ccm-cassandra-${{ runner.os }}-${{ matrix.cassandra-version }}
200
+
142
201
- name : Run integration tests on Cassandra (${{ matrix.cassandra-version }})
143
202
run : mvn -B -e verify -Dccm.version=${{ matrix.cassandra-version }} -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
144
203
204
+ - name : Save CCM image cache
205
+ uses : actions/cache/save@v4
206
+ if : steps.ccm-cache.outputs.cache-hit != 'true'
207
+ with :
208
+ path : ~/.ccm/repository
209
+ key : ccm-cassandra-${{ runner.os }}-${{ matrix.cassandra-version }}
210
+
145
211
- name : Copy test results
146
212
if : success() || failure()
147
213
run : |
148
214
shopt -s globstar
149
215
mkdir cassandra-${{ matrix.cassandra-version }}
150
216
cp --parents ./**/target/*-reports/*.xml cassandra-${{ matrix.cassandra-version }}/
217
+
151
218
- name : Upload test results
152
219
uses : actions/upload-artifact@v2
153
220
if : success() || failure()
@@ -171,6 +238,7 @@ jobs:
171
238
strategy :
172
239
matrix :
173
240
scylla-version : ${{ fromJson(needs.setup-integration-tests.outputs.scylla-integration-tests-versions) }}
241
+ java-version : [8]
174
242
fail-fast : false
175
243
176
244
steps :
@@ -180,9 +248,15 @@ jobs:
180
248
- name : Set up JDK 8
181
249
uses : actions/setup-java@v2
182
250
with :
183
- java-version : ' 8 '
251
+ java-version : ${{ matrix.java-version }}
184
252
distribution : ' adopt'
185
253
254
+ - name : Restore maven repository cache
255
+ uses : actions/cache/restore@v4
256
+ with :
257
+ path : ~/.m2/repository
258
+ key : ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
259
+
186
260
- name : Setup Python 3
187
261
uses : actions/setup-python@v2
188
262
with :
@@ -192,15 +266,31 @@ jobs:
192
266
run : |
193
267
pip3 install https://github.com/scylladb/scylla-ccm/archive/a93125bc6ad7dd5c9694331e89dc1fb212431ffe.zip
194
268
sudo sh -c "echo 2097152 > /proc/sys/fs/aio-max-nr"
269
+
270
+ - name : Restore CCM image cache
271
+ uses : actions/cache/restore@v4
272
+ id : ccm-cache
273
+ with :
274
+ path : ~/.ccm/scylla-repository
275
+ key : ccm-scylla-${{ runner.os }}-${{ matrix.scylla-version }}
276
+
195
277
- name : Run integration tests on Scylla (${{ matrix.scylla-version }})
196
278
run : mvn -B verify -Dccm.version=${{ matrix.scylla-version }} -Dccm.scylla=true -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
197
279
280
+ - name : Save CCM image cache
281
+ uses : actions/cache/save@v4
282
+ if : steps.ccm-cache.outputs.cache-hit != 'true'
283
+ with :
284
+ path : ~/.ccm/repository
285
+ key : ccm-scylla-${{ runner.os }}-${{ matrix.scylla-version }}
286
+
198
287
- name : Copy test results
199
288
if : success() || failure()
200
289
run : |
201
290
shopt -s globstar
202
291
mkdir scylla-${{ matrix.scylla-version }}
203
292
cp --parents ./**/target/*-reports/*.xml scylla-${{ matrix.scylla-version }}/
293
+
204
294
- name : Upload test results
205
295
uses : actions/upload-artifact@v2
206
296
if : success() || failure()
0 commit comments