-
Notifications
You must be signed in to change notification settings - Fork 109
495 lines (484 loc) · 19.1 KB
/
gradle.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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
name: Tessera Gradle Build
on:
pull_request:
push:
branches:
- master
env:
GRADLE_CACHE_KEY: ${{ github.run_id }}-gradle-${{ github.run_number }}-${{ github.run_number }}-${{ github.sha }}
DIST_TAR: tessera-dist/build/distributions/tessera-*.tar
TESSERA_DOCKER_IMAGE: quorumengineering/tessera
QUORUM_DOCKER_IMAGE: quorumengineering/quorum
jobs:
build:
name: Build and upload binaries
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
check-latest: true
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build -x dependencyCheckAnalyze -x javadoc -x test --info
- name: Upload tessera dist
uses: actions/upload-artifact@v2
if: success()
with:
name: tessera-dists
path: /home/runner/work/tessera/tessera/tessera-dist/build/distributions/
- name: Upload tessera enclave dist
uses: actions/upload-artifact@v2
with:
name: enclave-dists
path: /home/runner/work/tessera/tessera/enclave/enclave-jaxrs/build/distributions/
- name: Upload aws key vault dist
uses: actions/upload-artifact@v2
with:
name: aws-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/aws-key-vault/build/distributions/
- name: Upload azure key vault dist
uses: actions/upload-artifact@v2
with:
name: azure-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/azure-key-vault/build/distributions/
- name: Upload hashicorp key vault dist
uses: actions/upload-artifact@v2
with:
name: hashicorp-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/hashicorp-key-vault/build/distributions/
- name: Upload kalium encryptor dist
uses: actions/upload-artifact@v2
with:
name: kalium-dist
path: /home/runner/work/tessera/tessera/encryption/encryption-kalium/build/distributions/
checkdependencies:
name: Check dependencies for any security advisories
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
check-latest: true
- name: Execute gradle dependencyCheckAnalyze task
run: ./gradlew dependencyCheckAnalyze -x test
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
check-latest: true
- name: Execute gradle test
run: ./gradlew test -x dependencyCheckAnalyze -x :tests:acceptance-test:test -x javadoc --info
itest:
name: Integration tests
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
check-latest: true
- name: Download tessera dist
uses: actions/download-artifact@v2
with:
name: tessera-dists
path: /home/runner/work/tessera/tessera/tessera-dist/build/distributions/
- name: Download tessera enclave dist
uses: actions/download-artifact@v2
with:
name: enclave-dists
path: /home/runner/work/tessera/tessera/enclave/enclave-jaxrs/build/distributions/
- name: Download aws key vault dist
uses: actions/download-artifact@v2
with:
name: aws-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/aws-key-vault/build/distributions/
- name: Download azure key vault dist
uses: actions/download-artifact@v2
with:
name: azure-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/azure-key-vault/build/distributions/
- name: Download hashicorp key vault dist
uses: actions/download-artifact@v2
with:
name: hashicorp-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/hashicorp-key-vault/build/distributions/
- name: Download kalium encryptor dist
uses: actions/download-artifact@v2
with:
name: kalium-dist
path: /home/runner/work/tessera/tessera/encryption/encryption-kalium/build/distributions/
- name: Execute gradle integration tests
run: |
./gradlew :tests:acceptance-test:clean :tests:acceptance-test:test --fail-fast -PexcludeTests="RunHashicorpIT,AwsKeyVaultIT,RecoverIT,RunAzureIT,AzureKeyVaultIT,RestSuiteHttpH2RemoteEnclaveEncTypeEC,CucumberTestSuite" --info
- name: Upload Junit reports
uses: actions/upload-artifact@v2
if: always()
with:
name: itest-junit-report
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/reports/tests/
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: itest-logs
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/logs
remote_enclave_itest:
name: Remote enclave integration tests
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
check-latest: true
- name: Download tessera dist
uses: actions/download-artifact@v2
with:
name: tessera-dists
path: /home/runner/work/tessera/tessera/tessera-dist/build/distributions/
- name: Download tessera enclave dist
uses: actions/download-artifact@v2
with:
name: enclave-dists
path: /home/runner/work/tessera/tessera/enclave/enclave-jaxrs/build/distributions/
- name: Download aws key vault dist
uses: actions/download-artifact@v2
with:
name: aws-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/aws-key-vault/build/distributions/
- name: Download azure key vault dist
uses: actions/download-artifact@v2
with:
name: azure-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/azure-key-vault/build/distributions/
- name: Download hashicorp key vault dist
uses: actions/download-artifact@v2
with:
name: hashicorp-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/hashicorp-key-vault/build/distributions/
- name: Download kalium encryptor dist
uses: actions/download-artifact@v2
with:
name: kalium-dist
path: /home/runner/work/tessera/tessera/encryption/encryption-kalium/build/distributions/
- name: Execute gradle integration tests
run: |
./gradlew :tests:acceptance-test:test --tests RestSuiteHttpH2RemoteEnclave --tests RestSuiteHttpH2RemoteEnclaveEncTypeEC --info
- name: Upload junit reports
uses: actions/upload-artifact@v2
if: always()
with:
name: remote_enclave_itest-junit-report
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/reports/tests/
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: remote_enclave_itest-logs
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/logs
cucumber_itest:
name: Cucumber itests
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
check-latest: true
- name: Download tessera dist
uses: actions/download-artifact@v2
with:
name: tessera-dists
path: /home/runner/work/tessera/tessera/tessera-dist/build/distributions/
- name: Download tessera enclave dist
uses: actions/download-artifact@v2
with:
name: enclave-dists
path: /home/runner/work/tessera/tessera/enclave/enclave-jaxrs/build/distributions/
- name: Download aws key vault dist
uses: actions/download-artifact@v2
with:
name: aws-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/aws-key-vault/build/distributions/
- name: Download azure key vault dist
uses: actions/download-artifact@v2
with:
name: azure-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/azure-key-vault/build/distributions/
- name: Download hashicorp key vault dist
uses: actions/download-artifact@v2
with:
name: hashicorp-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/hashicorp-key-vault/build/distributions/
- name: Download kalium encryptor dist
uses: actions/download-artifact@v2
with:
name: kalium-dist
path: /home/runner/work/tessera/tessera/encryption/encryption-kalium/build/distributions/
- name: Execute gradle
run: |
./gradlew :tests:acceptance-test:clean :tests:acceptance-test:test --tests CucumberTestSuite --info
- name: Upload junit reports
uses: actions/upload-artifact@v2
if: always()
with:
name: cucumber_itest-junit-report
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/reports/tests/
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: cucumber_itest-logs
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/logs
vaultTests:
name: Key vault integration tests
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
check-latest: true
- name: Download tessera dist
uses: actions/download-artifact@v2
with:
name: tessera-dists
path: /home/runner/work/tessera/tessera/tessera-dist/build/distributions/
- name: Download tessera enclave dist
uses: actions/download-artifact@v2
with:
name: enclave-dists
path: /home/runner/work/tessera/tessera/enclave/enclave-jaxrs/build/distributions/
- name: Download aws key vault dist
uses: actions/download-artifact@v2
with:
name: aws-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/aws-key-vault/build/distributions/
- name: Download azure key vault dist
uses: actions/download-artifact@v2
with:
name: azure-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/azure-key-vault/build/distributions/
- name: Download hashicorp key vault dist
uses: actions/download-artifact@v2
with:
name: hashicorp-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/hashicorp-key-vault/build/distributions/
- name: Download kalium encryptor dist
uses: actions/download-artifact@v2
with:
name: kalium-dist
path: /home/runner/work/tessera/tessera/encryption/encryption-kalium/build/distributions/
- name: Run AWS tests
run: |
./gradlew :tests:acceptance-test:test --tests AwsKeyVaultIT --info
- name: Run azure tests (node starts)
run: |
./gradlew :tests:acceptance-test:test --tests AzureKeyVaultIT --info
# - name: Run azure tests (cucumber)
# run: |
# ./gradlew :tests:acceptance-test:test --tests RunAzureIT --info
- name: Run hashicorp tests
run: |
wget https://releases.hashicorp.com/vault/1.2.2/vault_1.2.2_linux_amd64.zip -O /tmp/vault_1.2.2_linux_amd64.zip
mkdir -p vault/bin && pushd $_
unzip /tmp/vault_1.2.2_linux_amd64.zip
export PATH=$PATH:$PWD && popd
./gradlew :tests:acceptance-test:test --tests RunHashicorpIT --info
- name: Upload junit reports
uses: actions/upload-artifact@v2
if: failure()
with:
name: vault-itest-junit-report
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/reports/tests/
- name: Upload test logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: vault-itest-logs
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/logs
recovery_itest:
name: Recovery integration tests
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- name: Set up java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
check-latest: true
- name: Download tessera dist
uses: actions/download-artifact@v2
with:
name: tessera-dists
path: /home/runner/work/tessera/tessera/tessera-dist/build/distributions/
- name: Download tessera enclave dist
uses: actions/download-artifact@v2
with:
name: enclave-dists
path: /home/runner/work/tessera/tessera/enclave/enclave-jaxrs/build/distributions/
- name: Download aws key vault dist
uses: actions/download-artifact@v2
with:
name: aws-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/aws-key-vault/build/distributions/
- name: Download azure key vault dist
uses: actions/download-artifact@v2
with:
name: azure-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/azure-key-vault/build/distributions/
- name: Download hashicorp key vault dist
uses: actions/download-artifact@v2
with:
name: hashicorp-key-vault-dist
path: /home/runner/work/tessera/tessera/key-vault/hashicorp-key-vault/build/distributions/
- name: Download kalium encryptor dist
uses: actions/download-artifact@v2
with:
name: kalium-dist
path: /home/runner/work/tessera/tessera/encryption/encryption-kalium/build/distributions/
- name: Execute tests
run: |
./gradlew :tests:acceptance-test:clean :tests:acceptance-test:test --tests RecoverIT --info
- name: Upload junit reports
uses: actions/upload-artifact@v2
if: always()
with:
name: recovery_itest-junit-report
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/reports/tests/
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: recovery-itest-logs
path: /home/runner/work/tessera/tessera/tests/acceptance-test/build/logs
build_image:
name: Build develop Docker image
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- name: Download tessera dist
uses: actions/download-artifact@v2
with:
name: tessera-dists
path: /home/runner/work/tessera/tessera/tessera-dist/build/distributions/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get current date-time (RFC 3339 standard)
id: date
run: echo "::set-output name=now::$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
- name: Build Docker image as portable tar
uses: docker/build-push-action@v2
with:
tags: ${{ env.TESSERA_DOCKER_IMAGE }}:develop
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.date.outputs.now }}
push: false
file: docker/tessera.Dockerfile
# context must be explicitly provided to prevent docker/build-push-action checking out the repo again and deleting the downloaded artifacts
context: .
outputs: type=docker,dest=/tmp/tessera-develop-image.tar
- name: upload-artifact portable Docker image
uses: actions/upload-artifact@v2
with:
name: tessera-develop-image
path: /tmp/tessera-develop-image.tar
atest:
name: Quorum acceptance tests
needs: [build, build_image]
runs-on: ubuntu-latest
steps:
- name: Checkout code from SCM
uses: actions/checkout@v2
- name: Set up java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 14
check-latest: true
- name: download-artifact portable Docker image
uses: actions/download-artifact@v2
with:
name: tessera-develop-image
path: /tmp
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Load image
run: |
docker load --input /tmp/tessera-develop-image.tar
docker image ls -a
- name: Execute acceptance tests
run:
docker run --entrypoint /bin/sh --network host -v /tmp/run/sh:/tmp/run.sh -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/acctests:/tmp/acctests -e TF_VAR_tessera_docker_image='{name="${{ env.TESSERA_DOCKER_IMAGE }}:develop",local=true}' -e TF_VAR_quorum_docker_image='{name="${{ env.QUORUM_DOCKER_IMAGE }}:latest",local=false}' quorumengineering/acctests:latest -c "./mvnw --no-transfer-progress -B -DskipToolsCheck test -Pauto -Dtags='\!async && (basic || basic-istanbul || networks/typical::istanbul)' -Dauto.outputDir=/tmp/acctests -Dnetwork.forceDestroy=true && cp -R /workspace/target/gauge /tmp/acctests/gauge && chmod -R 775 /tmp/acctests/gauge"
- name: Upload Gauge report
uses: actions/upload-artifact@v2
if: always()
with:
name: gauge-reports
path: /tmp/acctests/gauge
push_docker_develop:
name: Push develop image to DockerHub
if: ${{ github.ref == 'refs/heads/master' }}
# arguably we should depend on all test steps, but this job only runs on pushes to master so all tests will have
# already passed in the PR. At a minimum we depend on atest as it actually uses the image.
needs: [build_image, atest]
runs-on: ubuntu-latest
steps:
- name: download-artifact portable Docker image
uses: actions/download-artifact@v2
with:
name: tessera-develop-image
path: /tmp
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Load image
run: |
docker load --input /tmp/tessera-develop-image.tar
docker image ls -a
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Push image
run : |
docker push ${TESSERA_DOCKER_IMAGE}:develop