forked from eclipse-edc/Connector
-
Notifications
You must be signed in to change notification settings - Fork 0
409 lines (341 loc) · 12 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
name: Test Code (Style, Tests)
on:
workflow_dispatch:
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
# Disabled our dependency rules for now, as they are outdated and need to be refactored:
# https://github.com/eclipse-edc/Connector/issues/2132
# explicitly set 1G heap space because we've seen OOMs previously
run: ./gradlew -Dorg.gradle.jvmargs="-Xmx1g" buildHealth -Pdependency.analysis=warn -Pdependency.analysis.clear.artifacts=false
- name: Dependency analysis report
run: cat build/reports/dependency-analysis/build-health-report.txt
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
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 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 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 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: |
export DAPS_RESOURCES=${{ github.workspace }}/extensions/common/iam/oauth2/oauth2-daps/src/test/resources
docker run -d --rm -p 4567:4567 -v $DAPS_RESOURCES/config:/opt/config -v $DAPS_RESOURCES/keys:/opt/keys ghcr.io/fraunhofer-aisec/omejdn-server:1.4.2
- name: Daps Integration Tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew -p extensions/common/iam/oauth2/oauth2-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@v3
- uses: ./.github/actions/setup-build
- name: Hashicorp Vault Integration Tests
uses: ./.github/actions/run-tests
with:
command: ./gradlew -p extensions 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"
API-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="ApiTest"
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 extensions/common/metrics/micrometer-core/ 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/data-plane/data-plane-azure-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:
- API-Tests
- Aws-Integration-Tests
- Azure-Cloud-Integration-Test
- Azure-CosmosDB-Integration-Tests
- Azure-Storage-Integration-Tests
- Component-Tests
- Daps-Integration-Tests
- End-To-End-Tests
- Hashicorp-Vault-Integration-Tests
- OpenTelemetry-Integration-Tests
- Postgresql-Integration-Tests
- Unit-Tests
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:
- API-Tests
- 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