forked from eclipse-edc/Connector
-
Notifications
You must be signed in to change notification settings - Fork 0
486 lines (405 loc) · 14.9 KB
/
verify.yaml
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
name: Test Code (Style, Tests)
on:
push:
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
- 'docs/**'
- 'CODEOWNERS'
- 'LICENSE'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Checkstyle:
permissions:
id-token: write
checks: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Run Checkstyle
run: ./gradlew checkstyleMain checkstyleTest checkstyleTestFixtures
Dependency-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Dependency rules report # possible severity values: <'fail'|'warn'|'ignore'>
run: ./gradlew buildHealth applyDependencyRules -Pdependency.analysis=warn -Pdependency.analysis.clear.artifacts=false
- name: Dependency analysis report
run: cat build/reports/dependency-analysis/build-health-report.txt
OpenAPI-Definitions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
# do this first so that git is clear
# delete - recreate - assert no change
- name: Check that static SwaggerUI HTML content is up-to-date
run: |
rm -rf docs/swaggerui
./gradlew generateSwaggerUI
git diff --exit-code
- name: Save previous OpenAPI definition
run: yq -P 'sort_keys(..)' resources/openapi/openapi.yaml > openapi-git-sorted.yaml
- name: Generate OpenAPI definitions from code
run: |
./gradlew resolve
./gradlew mergeOpenApiFiles
# Can be used (and yq tasks removed) when https://github.com/kpramesh2212/openapi-merger-plugin/pull/11/files is merged
#- name: Check OpenAPI definitions match code
# run: git diff --exit-code
- name: Check OpenAPI definitions match code
run: |
yq -P 'sort_keys(..)' resources/openapi/openapi.yaml > openapi-ci-sorted.yaml
diff openapi-git-sorted.yaml openapi-ci-sorted.yaml
Unit-Tests:
runs-on: ubuntu-latest
env:
JACOCO: true
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Run unit tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew test jacocoTestReport
Sanity-Check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Check Sample 01
run: |
./gradlew :samples:01-basic-connector:shadowJar
echo "Checking Sample 01"
java -jar samples/01-basic-connector/build/libs/basic-connector.jar > log.txt &
sleep 5
grep "INFO.*edc-.*ready" log.txt
rm log.txt
killall java
- name: Check Sample 02
run: |
./gradlew :samples:02-health-endpoint:shadowJar
echo "Checking Sample 02"
java -jar samples/02-health-endpoint/build/libs/connector-health.jar > log.txt &
sleep 5
grep "INFO.*edc-.*ready" log.txt
rm log.txt
killall java
- name: Check Sample 03
run: |
./gradlew :samples:03-configuration:shadowJar
echo "Checking Sample 03"
java -Dedc.fs.config=samples/03-configuration/config.properties -jar samples/03-configuration/build/libs/filsystem-config-connector.jar > log.txt &
sleep 5
grep "INFO.*edc-.*ready" log.txt
rm log.txt
killall java
- name: Check Sample 04.0 (Consumer)
run: |
./gradlew :samples:04.0-file-transfer:consumer:shadowJar
echo "Checking Sample 04 - Consumer"
java -Dedc.fs.config=samples/04.0-file-transfer/consumer/config.properties -jar samples/04.0-file-transfer/consumer/build/libs/consumer.jar > log.txt &
sleep 5
grep "INFO.*edc-.*ready" log.txt
rm log.txt
killall java
- name: Check Sample 04.0 (Provider)
run: |
echo "Checking Sample 04 - Provider"
./gradlew :samples:04.0-file-transfer:provider:shadowJar
java -Dedc.fs.config=samples/04.0-file-transfer/provider/config.properties -jar samples/04.0-file-transfer/provider/build/libs/provider.jar > log.txt &
sleep 5
grep "INFO.*edc-.*ready" log.txt
rm log.txt
killall java
- name: Check Sample 04.2 (Command-Q/Watchdog)
run: |
echo "Checking Sample 04.2 - Command-Q/Watchdog"
./gradlew :samples:04.2-modify-transferprocess:consumer:shadowJar
java -Dedc.fs.config=samples/04.2-modify-transferprocess/consumer/config.properties -jar samples/04.2-modify-transferprocess/consumer/build/libs/consumer.jar > log.txt &
sleep 5
grep "INFO.*edc-.*ready" log.txt
rm log.txt
killall java
# we cannot check sample 5 currently because we'd need repo secrets for that (client id,...)
Helm-Chart:
runs-on: ubuntu-latest
name: Test Helm chart in minikube
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Install and start minikube
run: |
curl -fLo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
./minikube start --wait all
- name: Build JARs
run: ./gradlew system-tests:runtimes:file-transfer-consumer:shadowJar system-tests:runtimes:file-transfer-provider:shadowJar --no-daemon
- name: Test
run: |
eval $(minikube -p minikube docker-env)
chmod +x system-tests/minikube/minikube-test.sh
system-tests/minikube/minikube-test.sh
- name: Kubernetes logs
if: always()
run: |
set -x
kubectl get pods
kubectl logs deployment/provider-dataspace-connector --tail=200
kubectl logs deployment/consumer-dataspace-connector --tail=200
Azure-Storage-Integration-Tests:
runs-on: ubuntu-latest
services:
azurite:
image: mcr.microsoft.com/azure-storage/azurite
ports:
- 10000:10000
env:
AZURITE_ACCOUNTS: account1:key1;account2:key2
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Azure Storage Tests
uses: ./.github/actions/run-tests
with:
command: |
./gradlew -p extensions/azure test -DincludeTags="AzureStorageIntegrationTest"
./gradlew -p system-tests/azure-tests test -DincludeTags="AzureStorageIntegrationTest"
- name: "Publish Gatling report"
uses: actions/upload-artifact@v3
if: always()
with:
name: Gatling reports
path: '**/build/reports/gatling/**'
Check-Cosmos-Key:
runs-on: ubuntu-latest
steps:
- id: has-cosmos-key
env:
HAS_COSMOS_KEY: ${{ secrets.COSMOS_KEY }}
if: "${{ env.HAS_COSMOS_KEY != '' }}"
run: echo "::set-output name=defined::true"
outputs:
has-cosmos-key: ${{ steps.has-cosmos-key.outputs.defined }}
Azure-CosmosDB-Integration-Tests:
# run only if COSMOS_KEY is present
needs: [ Check-Cosmos-Key ]
if: needs.Check-Cosmos-Key.outputs.has-cosmos-key == 'true'
runs-on: ubuntu-latest
env:
COSMOS_KEY: ${{ secrets.COSMOS_KEY }}
COSMOS_URL: ${{ secrets.COSMOS_URL }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Azure CosmosDB Tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew -p extensions/azure/cosmos test -DincludeTags="AzureCosmosDbIntegrationTest"
Aws-Integration-Tests:
runs-on: ubuntu-latest
env:
S3_ACCESS_KEY_ID: root
S3_SECRET_ACCESS_KEY: password
services:
minio:
image: bitnami/minio:latest
ports:
- 9000:9000
env:
MINIO_ROOT_USER: root
MINIO_ROOT_PASSWORD: password
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: AWS Tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew -p extensions/aws test -DincludeTags="AwsS3IntegrationTest"
Daps-Integration-Tests:
runs-on: ubuntu-latest
steps:
- name: reset permissions to permit checkout (because the omejdn volumes)
run: sudo chown -R $USER:$USER ${{ github.workspace }}
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- run: docker run -d --rm -p 4567:4567 -v ${{ github.workspace }}/extensions/iam/daps/src/test/resources/config:/opt/config -v ${{ github.workspace }}/extensions/iam/daps/src/test/resources/keys:/opt/keys ghcr.io/fraunhofer-aisec/omejdn-server:1.3.1
- name: Daps Integration Tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew -p extensions/iam/daps test -DincludeTags="DapsIntegrationTest"
Postgresql-Integration-Tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.2
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: password
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Postgresql Tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew test -DincludeTags="PostgresqlIntegrationTest"
Hashicorp-Vault-Integration-Tests:
runs-on: ubuntu-latest
services:
vault:
image: vault:1.9.7
ports:
- 8200:8200
env:
VAULT_DEV_ROOT_TOKEN_ID: test-token
VAULT_TOKEN: test-token
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-build
- name: Hashicorp Vault Integration Tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew -p extensions/hashicorp-vault test -DincludeTags="HashicorpVaultIntegrationTest"
End-To-End-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: End to End Integration Tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew test -DincludeTags="EndToEndTest"
- name: "Publish Gatling report"
uses: actions/upload-artifact@v3
if: always()
with:
name: Gatling reports
path: '**/build/reports/gatling/**'
Component-Tests:
env:
JACOCO: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Component Tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew test jacocoTestReport -DincludeTags="ComponentTest"
OpenTelemetry-Integration-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: Download opentelemetry javaagent
run: wget -q https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.0/opentelemetry-javaagent.jar
- name: OpenTelemetry Integration Tests
uses: ./.github/actions/run-tests
with:
command: |
./gradlew -p core/micrometer test -DincludeTags="OpenTelemetryIntegrationTest"
./gradlew -p system-tests/tests test -DincludeTags="OpenTelemetryIntegrationTest"
Check-Cloud-Environments:
environment: Azure-dev
runs-on: ubuntu-latest
# Grant permissions to obtain federated identity credentials
# see https://docs.github.com/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure
permissions:
id-token: write
contents: read
steps:
- id: has-azure
env:
HAS_AZURE: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
if: "${{ env.HAS_AZURE != '' }}"
run: echo "::set-output name=defined::true"
outputs:
has-azure: ${{ steps.has-azure.outputs.defined }}
Azure-Cloud-Integration-Test:
needs: [ Check-Cloud-Environments ]
if: needs.Check-Cloud-Environments.outputs.has-azure == 'true'
environment: Azure-dev
runs-on: ubuntu-latest
# Grant permissions to obtain federated identity credentials
# see https://docs.github.com/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: "Fetch Terraform outputs"
run: printf "$RUNTIME_SETTINGS" > resources/azure/testing/runtime_settings.properties
env:
RUNTIME_SETTINGS: ${{ secrets.RUNTIME_SETTINGS }}
- name: Data Plane Azure Data Factory Test
uses: ./.github/actions/run-tests
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
with:
command: |
./gradlew -p extensions/azure/data-plane/data-factory test -DincludeTags="AzureDataFactoryIntegrationTest"
./gradlew -p system-tests/azure-data-factory-tests test -DincludeTags="AzureDataFactoryIntegrationTest"
- name: "Publish Gatling report"
uses: actions/upload-artifact@v3
if: always()
with:
name: Gatling reports
path: '**/build/reports/gatling/**'
Upload-Test-Report:
needs:
- Unit-Tests
- Azure-Storage-Integration-Tests
- Azure-CosmosDB-Integration-Tests
- Aws-Integration-Tests
- Daps-Integration-Tests
- End-To-End-Tests
- Postgresql-Integration-Tests
- Component-Tests
- OpenTelemetry-Integration-Tests
- Azure-Cloud-Integration-Test
permissions:
checks: write
pull-requests: write
runs-on: ubuntu-latest
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: "**/test-results/**/*.xml"
Upload-Coverage-Report-To-Codecov:
needs:
- Unit-Tests
- Component-Tests
runs-on: ubuntu-latest
if: always()
steps:
# Sources are needed for Codecov report
- uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: CodeCov
uses: codecov/codecov-action@v3