forked from aws/aws-cdk-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
297 lines (296 loc) · 10.5 KB
/
integ.yml
File metadata and controls
297 lines (296 loc) · 10.5 KB
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
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: integ
on:
pull_request_target:
branches: []
merge_group: {}
workflow_dispatch: {}
jobs:
prepare:
runs-on: aws-cdk_ubuntu-latest_16-core
permissions:
contents: read
environment: integ-approval
env:
CI: "true"
DEBUG: "true"
if: github.event_name != 'merge_group' && !contains(github.event.pull_request.labels.*.name, 'pr/exempt-integ-test')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Fetch tags from origin repo
run: |-
git remote add upstream https://github.com/aws/aws-cdk-cli.git
git fetch upstream 'refs/tags/*:refs/tags/*'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: yarn install --check-files
- name: Bump to realistic versions
env:
TESTING_CANDIDATE: "true"
run: yarn workspaces run bump
- name: build
env:
RELEASE: "true"
run: npx projen build
- name: Upload artifact
uses: actions/upload-artifact@v4.4.0
with:
name: build-artifact
path: packages/**/dist/js/*.tgz
overwrite: "true"
- name: Upload scripts
uses: actions/upload-artifact@v4.4.0
with:
name: script-artifact
path: .projen/*.sh
overwrite: "true"
include-hidden-files: true
telemetry_tests:
needs: prepare
runs-on: aws-cdk_ubuntu-latest_16-core
permissions:
contents: read
id-token: write
environment: run-tests
env:
MAVEN_ARGS: --no-transfer-progress
IS_CANARY: "true"
CI: "true"
if: github.event_name != 'merge_group' && !contains(github.event.pull_request.labels.*.name, 'pr/exempt-integ-test')
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifact
path: packages
- name: Download scripts
uses: actions/download-artifact@v4
with:
name: script-artifact
path: .projen
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Authenticate Via OIDC Role
id: creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-duration-seconds: 3600
role-to-assume: ${{ vars.CDK_ATMOSPHERE_PROD_OIDC_ROLE }}
role-session-name: telemetry-tests@aws-cdk-cli-integ
output-credentials: true
- name: Set git identity
run: |-
git config --global user.name "aws-cdk-cli-integ"
git config --global user.email "noreply@example.com"
- name: Prepare Verdaccio
run: chmod +x .projen/prepare-verdaccio.sh && .projen/prepare-verdaccio.sh
- name: Download and install the test artifact
run: npm install @aws-cdk-testing/cli-integ
- name: Determine latest package versions
id: versions
run: |-
CLI_VERSION=$(cd ${TMPDIR:-/tmp} && npm view aws-cdk version)
echo "CLI version: ${CLI_VERSION}"
echo "cli_version=${CLI_VERSION}" >> $GITHUB_OUTPUT
LIB_VERSION=$(cd ${TMPDIR:-/tmp} && npm view aws-cdk-lib version)
echo "lib version: ${LIB_VERSION}"
echo "lib_version=${LIB_VERSION}" >> $GITHUB_OUTPUT
- name: Run telemetry tests
env:
JSII_SILENCE_WARNING_DEPRECATED_NODE_VERSION: "true"
JSII_SILENCE_WARNING_UNTESTED_NODE_VERSION: "true"
JSII_SILENCE_WARNING_KNOWN_BROKEN_NODE_VERSION: "true"
DOCKERHUB_DISABLED: "true"
CDK_INTEG_ATMOSPHERE_ENABLED: "true"
CDK_INTEG_ATMOSPHERE_ENDPOINT: ${{ vars.CDK_ATMOSPHERE_PROD_ENDPOINT }}
CDK_INTEG_ATMOSPHERE_POOL: ${{ vars.CDK_INTEG_ATMOSPHERE_POOL }}
CDK_MAJOR_VERSION: "2"
RELEASE_TAG: latest
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INTEG_LOGS: logs
run: npx run-suite --use-cli-release=${{ steps.versions.outputs.cli_version }} --framework-version=${{ steps.versions.outputs.lib_version }} telemetry-integ-tests
- name: Set workflow summary
if: always()
run: |-
if compgen -G "logs/md/*.md" > /dev/null; then
cat logs/md/*.md >> $GITHUB_STEP_SUMMARY;
fi
- name: Upload logs
id: logupload
if: always()
uses: actions/upload-artifact@v4.4.0
with:
name: logs-telemetry-tests
path: logs/
overwrite: "true"
- name: Append artifact URL
if: always()
run: |-
echo "" >> $GITHUB_STEP_SUMMARY
echo "[Logs](${{ steps.logupload.outputs.artifact-url }})" >> $GITHUB_STEP_SUMMARY
integ_matrix:
needs:
- prepare
- telemetry_tests
runs-on: aws-cdk_ubuntu-latest_16-core
permissions:
contents: read
id-token: write
environment: run-tests
env:
MAVEN_ARGS: --no-transfer-progress
IS_CANARY: "true"
CI: "true"
if: github.event_name != 'merge_group' && !contains(github.event.pull_request.labels.*.name, 'pr/exempt-integ-test')
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifact
path: packages
- name: Download scripts
uses: actions/download-artifact@v4
with:
name: script-artifact
path: .projen
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Set up JDK 18
if: matrix.suite == 'init-java' || matrix.suite == 'cli-integ-tests'
uses: actions/setup-java@v4
with:
java-version: "18"
distribution: corretto
- name: Authenticate Via OIDC Role
id: creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-duration-seconds: 3600
role-to-assume: ${{ vars.CDK_ATMOSPHERE_PROD_OIDC_ROLE }}
role-session-name: run-tests@aws-cdk-cli-integ
output-credentials: true
- name: Set git identity
run: |-
git config --global user.name "aws-cdk-cli-integ"
git config --global user.email "noreply@example.com"
- name: Prepare Verdaccio
run: chmod +x .projen/prepare-verdaccio.sh && .projen/prepare-verdaccio.sh
- name: Download and install the test artifact
run: npm install @aws-cdk-testing/cli-integ
- name: Determine latest package versions
id: versions
run: |-
CLI_VERSION=$(cd ${TMPDIR:-/tmp} && npm view aws-cdk version)
echo "CLI version: ${CLI_VERSION}"
echo "cli_version=${CLI_VERSION}" >> $GITHUB_OUTPUT
LIB_VERSION=$(cd ${TMPDIR:-/tmp} && npm view aws-cdk-lib version)
echo "lib version: ${LIB_VERSION}"
echo "lib_version=${LIB_VERSION}" >> $GITHUB_OUTPUT
- name: "Run the test suite: ${{ matrix.suite }}"
env:
JSII_SILENCE_WARNING_DEPRECATED_NODE_VERSION: "true"
JSII_SILENCE_WARNING_UNTESTED_NODE_VERSION: "true"
JSII_SILENCE_WARNING_KNOWN_BROKEN_NODE_VERSION: "true"
DOCKERHUB_DISABLED: "true"
CDK_INTEG_ATMOSPHERE_ENABLED: "true"
CDK_INTEG_ATMOSPHERE_ENDPOINT: ${{ vars.CDK_ATMOSPHERE_PROD_ENDPOINT }}
CDK_INTEG_ATMOSPHERE_POOL: ${{ vars.CDK_INTEG_ATMOSPHERE_POOL }}
CDK_MAJOR_VERSION: "2"
RELEASE_TAG: latest
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INTEG_LOGS: logs
run: npx run-suite --use-cli-release=${{ steps.versions.outputs.cli_version }} --framework-version=${{ steps.versions.outputs.lib_version }} ${{ matrix.suite }}
- name: Set workflow summary
if: always()
run: |-
if compgen -G "logs/md/*.md" > /dev/null; then
cat logs/md/*.md >> $GITHUB_STEP_SUMMARY;
fi
- name: Slugify artifact id
id: artifactid
if: always()
env:
INPUT: logs-${{ matrix.suite }}-${{ matrix.node }}
run: |-
slug=$(node -p 'process.env.INPUT.replace(/[^a-z0-9._-]/gi, "-")')
echo "slug=$slug" >> "$GITHUB_OUTPUT"
- name: Upload logs
id: logupload
if: always()
uses: actions/upload-artifact@v4.4.0
with:
name: ${{ steps.artifactid.outputs.slug }}
path: logs/
overwrite: "true"
- name: Append artifact URL
if: always()
run: |-
echo "" >> $GITHUB_STEP_SUMMARY
echo "[Logs](${{ steps.logupload.outputs.artifact-url }})" >> $GITHUB_STEP_SUMMARY
strategy:
fail-fast: false
matrix:
include:
- suite: init-typescript-app
node: 18.17.0
- suite: init-typescript-app
node: "20"
- suite: init-typescript-app
node: "22"
- suite: init-typescript-app
node: "24"
- suite: toolkit-lib-integ-tests
node: 18.17.0
- suite: toolkit-lib-integ-tests
node: "20"
- suite: toolkit-lib-integ-tests
node: "22"
- suite: toolkit-lib-integ-tests
node: "24"
- suite: tool-integrations
node: 20
exclude:
- suite: tool-integrations
node: lts/*
suite:
- cli-integ-tests
- toolkit-lib-integ-tests
- init-csharp
- init-fsharp
- init-go
- init-java
- init-javascript
- init-python
- init-typescript-app
- init-typescript-lib
- tool-integrations
node:
- lts/*
integ:
needs:
- prepare
- telemetry_tests
- integ_matrix
runs-on: aws-cdk_ubuntu-latest_16-core
permissions: {}
if: always()
steps:
- name: Integ test result
run: echo ${{ needs.integ_matrix.result }}
- name: Set status based on matrix job
if: ${{ !(contains(fromJSON('["success", "skipped"]'), needs.prepare.result) && contains(fromJSON('["success", "skipped"]'), needs.telemetry_tests.result) && contains(fromJSON('["success", "skipped"]'), needs.integ_matrix.result)) }}
run: exit 1