forked from eclipse-edc/MinimumViableDataspace
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 3.08 KB
/
run_azure_dataspace_tests.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
name: Run Azure Dataspace Tests
on:
workflow_call:
inputs:
resources_prefix:
description: 'Resources name prefix used to avoid naming conflicts between resources of different DataSpaces. Must be 3 to 7 lowercase letters and digits, starting with a letter.'
required: true
type: string
workflow_dispatch:
inputs:
resources_prefix:
description: 'Resources name prefix used to avoid naming conflicts between resources of different DataSpaces. Must be 3 to 7 lowercase letters and digits, starting with a letter.'
required: true
type: string
# 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
checks: write
pull-requests: write
env:
RESOURCES_PREFIX: ${{ github.event.inputs.resources_prefix || inputs.resources_prefix }}
APP_OBJECT_ID: ${{ secrets.APP_OBJECT_ID }}
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
APP_CLIENT_SECRET: ${{ secrets.APP_CLIENT_SECRET }}
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
COMMON_RESOURCE_GROUP: ${{ secrets.COMMON_RESOURCE_GROUP }}
TERRAFORM_STATE_CONTAINER: ${{ secrets.TERRAFORM_STATE_CONTAINER }}
TERRAFORM_STATE_STORAGE_ACCOUNT: ${{ secrets.TERRAFORM_STATE_STORAGE_ACCOUNT }}
jobs:
Run-Azure-Dataspace-Tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: deployment/azure
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/gradle-setup
- name: 'Copy IdentityHub and RegistrationService CLI JARs'
run: |
./gradlew getJarsForLocalTest getJarsForAzureTest
working-directory: .
- name: 'Build runtimes'
run: |
./gradlew shadowJar
working-directory: .
- name: 'Create dataspace with Terraform'
run: |
./create_azure_dataspace.sh
az storage blob upload --overwrite -c $TERRAFORM_STATE_CONTAINER --account-name $TERRAFORM_STATE_STORAGE_ACCOUNT -f terraform/terraform.tfvars -n terraform.tfvars
- name: 'Run dataspace in Docker'
run: |
docker compose -f docker/docker-compose.yml up --build --wait
- name: 'Seed credentials and master data'
run: |
./seed_dataspace.sh
- name: 'Run all tests'
run: |
./gradlew test -DincludeTags="EndToEndTest,ComponentTest"
working-directory: .
- name: 'Destroy dataspace again'
run: |
./shutdown_azure_dataspace.sh
- name: 'Delete Terraform state'
run: |
az storage blob delete -c ${{ env.TERRAFORM_STATE_CONTAINER }} -n ${{ env.RESOURCES_PREFIX }} --account-name ${{ env.TERRAFORM_STATE_STORAGE_ACCOUNT }}
az storage blob delete -c ${{ env.TERRAFORM_STATE_CONTAINER }} -n terraform.tfvars --account-name ${{ env.TERRAFORM_STATE_STORAGE_ACCOUNT }}