-
Notifications
You must be signed in to change notification settings - Fork 3
201 lines (197 loc) · 8.77 KB
/
e2e_tests.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
name: Run E2E tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
azure-e2e-test:
name: Run end-to-end tests of Pulumi Kotlin Azure
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Check out project sources
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- name: Set up Pulumi CLI
uses: pulumi/actions@v5
- name: Publish Pulumi Kotlin Azure to Maven Local
run: ./gradlew publishPulumiAzureE2ePublicationToMavenLocal -q
- name: Publish Pulumi Kotlin Random to Maven Local
run: ./gradlew publishPulumiRandomE2ePublicationToMavenLocal -q
- name: Run E2E tests
id: run-azure-e2e-tests
run: ./gradlew e2eTest --tests AzureE2eTest
env:
# These values were copied from jvm-lab/identity-federation/dev stack's output
# The Azure tenant/subscription that is used here belongs to VirtusLab
ARM_TENANT_ID: 'd09acba4-fb14-464d-851a-44a7cf8a064d' # tenant-id output of jvm-lab/identity-federation/dev stack
ARM_SUBSCRIPTION_ID: '46170faf-ef0a-4e4a-af7e-4bf4206045a3' # subscription-id output of jvm-lab/identity-federation/dev stack
ARM_CLIENT_ID: 'e4e7a816-ca21-4527-9a57-f5ac641002f2' # service-principal-client-id output of jvm-lab/identity-federation/dev stack
ARM_CLIENT_SECRET: ${{ secrets.AZURE_SERVICE_PRINCIPAL_CLIENT_SECRET }} # This could be done by OIDC, but it's not supported by Pulumi yet (see https://github.com/VirtuslabRnD/pulumi-kotlin/issues/195)
# Pulumi personal access token manually added to `pulumi-kotlin` repo by @myhau (Michal Fudala)
PULUMI_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN_PULUMI }}
- name: Upload E2E test report
if: ${{ failure() && steps.run-azure-e2e-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: azure-e2e-test-report
path: ./build/reports/tests/e2eTest/*
retention-days: 3
azure-native-e2e-test:
name: Run end-to-end tests of Pulumi Kotlin Azure Native
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Check out project sources
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- name: Set up Pulumi CLI
uses: pulumi/actions@v5
- name: Publish Pulumi Kotlin Azure Native to Maven Local
run: ./gradlew publishPulumiAzure-nativeE2ePublicationToMavenLocal -q
- name: Publish Pulumi Kotlin Random to Maven Local
run: ./gradlew publishPulumiRandomE2ePublicationToMavenLocal -q
- name: Run E2E tests
id: run-azure-native-e2e-tests
run: ./gradlew e2eTest --tests AzureNativeE2eTest
env:
# These values were copied from jvm-lab/identity-federation/dev stack's output
# The Azure tenant/subscription that is used here belongs to VirtusLab
ARM_TENANT_ID: 'd09acba4-fb14-464d-851a-44a7cf8a064d' # tenant-id output of jvm-lab/identity-federation/dev stack
ARM_SUBSCRIPTION_ID: '46170faf-ef0a-4e4a-af7e-4bf4206045a3' # subscription-id output of jvm-lab/identity-federation/dev stack
ARM_CLIENT_ID: 'e4e7a816-ca21-4527-9a57-f5ac641002f2' # service-principal-client-id output of jvm-lab/identity-federation/dev stack
ARM_CLIENT_SECRET: ${{ secrets.AZURE_SERVICE_PRINCIPAL_CLIENT_SECRET }} # This could be done by OIDC, but it's not supported by Pulumi yet (see https://github.com/VirtuslabRnD/pulumi-kotlin/issues/195)
# Pulumi personal access token manually added to `pulumi-kotlin` repo by @myhau (Michal Fudala)
PULUMI_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN_PULUMI }}
- name: Upload E2E test report
if: ${{ failure() && steps.run-azure-native-e2e-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: azure-native-e2e-test-report
path: ./build/reports/tests/e2eTest/*
retention-days: 3
gcp-e2e-test:
name: Run end-to-end tests of Pulumi Kotlin GCP
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Check out project sources
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- name: Set up Pulumi CLI
uses: pulumi/actions@v5
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
id: auth
with:
# the credentials were generated using the following script:
# https://github.com/VirtuslabRnD/jvm-lab/blob/main/scripts/setup-github-actions-google-cloud-authentication.sh
workload_identity_provider: 'projects/954450653667/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
service_account: '[email protected]'
- name: Publish Pulumi Kotlin GCP to Maven Local
run: ./gradlew publishPulumiGcpE2ePublicationToMavenLocal -q
- name: Run E2E tests
id: run-gcp-e2e-tests
run: ./gradlew e2eTest --tests GcpE2eTest
env:
# Pulumi personal access token manually added to `pulumi-kotlin` repo by @myhau (Michal Fudala)
PULUMI_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN_PULUMI }}
- name: Upload E2E test report
if: ${{ failure() && steps.run-gcp-e2e-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: gcp-e2e-test-report
path: ./build/reports/tests/e2eTest/*
retention-days: 3
google-native-e2e-test:
name: Run end-to-end tests of Pulumi Kotlin Google Native
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Check out project sources
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- name: Set up Pulumi CLI
uses: pulumi/actions@v5
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
id: auth
with:
# the credentials were generated using the following script:
# https://github.com/VirtuslabRnD/jvm-lab/blob/main/scripts/setup-github-actions-google-cloud-authentication.sh
workload_identity_provider: 'projects/954450653667/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
service_account: '[email protected]'
- name: Publish Pulumi Kotlin Google Native to Maven Local
run: ./gradlew publishPulumiGoogle-nativeE2ePublicationToMavenLocal -q
- name: Run E2E tests
id: run-google-native-e2e-tests
run: ./gradlew e2eTest --tests GoogleNativeE2eTest
env:
# Pulumi personal access token manually added to `pulumi-kotlin` repo by @myhau (Michal Fudala)
PULUMI_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN_PULUMI }}
- name: Upload E2E test report
if: ${{ failure() && steps.run-google-native-e2e-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: google-native-e2e-test-report
path: ./build/reports/tests/e2eTest/*
retention-days: 3
kubernetes-e2e-test:
name: Run end-to-end tests of Pulumi Kotlin Kubernetes
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Check out project sources
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- name: Start Minikube
run: minikube start --force
- name: Set up Pulumi CLI
uses: pulumi/actions@v5
- name: Publish Pulumi Kotlin Kubernetes to Maven Local
run: ./gradlew publishPulumiKubernetesE2ePublicationToMavenLocal -q
- name: Run E2E tests
id: run-kubernetes-e2e-tests
run: ./gradlew e2eTest --tests KubernetesE2eTest
env:
# Pulumi personal access token manually added to `pulumi-kotlin` repo by @myhau (Michal Fudala)
PULUMI_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN_PULUMI }}
- name: Upload E2E test report
if: ${{ failure() && steps.run-kubernetes-e2e-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: kubernetes-e2e-test-report
path: ./build/reports/tests/e2eTest/*
retention-days: 3