-
Notifications
You must be signed in to change notification settings - Fork 12
152 lines (151 loc) · 5.95 KB
/
integ.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
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: integ
on:
pull_request_target:
branches:
- main
merge_group: {}
workflow_dispatch: {}
jobs:
prepare:
runs-on: aws-cdk_ubuntu-latest_4-core
permissions:
contents: read
environment: integ-approval
env:
CI: "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 }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- 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/[email protected]
with:
name: build-artifact
path: packages/**/dist/js/*.tgz
overwrite: "true"
integ_matrix:
needs: prepare
runs-on: aws-cdk_ubuntu-latest_4-core
permissions:
contents: read
id-token: write
environment: run-tests
env:
MAVEN_ARGS: --no-transfer-progress
IS_CANARY: "true"
CI: "true"
CLI_LIB_VERSION_MIRRORS_CLI: "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: 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: 14400
role-to-assume: ${{ vars.AWS_ROLE_TO_ASSUME_FOR_TESTING }}
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 "[email protected]"
- name: Install Verdaccio
run: npm install -g verdaccio pm2
- name: Create Verdaccio config
run: |-
mkdir -p $HOME/.config/verdaccio
echo '{"storage":"./storage","auth":{"htpasswd":{"file":"./htpasswd"}},"uplinks":{"npmjs":{"url":"https://registry.npmjs.org/"}},"packages":{"@aws-cdk/cloudformation-diff":{"access":"$all","publish":"$all","proxy":"none"},"cdk-assets":{"access":"$all","publish":"$all","proxy":"none"},"aws-cdk":{"access":"$all","publish":"$all","proxy":"none"},"@aws-cdk/cli-lib-alpha":{"access":"$all","publish":"$all","proxy":"none"},"cdk":{"access":"$all","publish":"$all","proxy":"none"},"**":{"access":"$all","proxy":"npmjs"}}}' > $HOME/.config/verdaccio/config.yaml
- name: Start Verdaccio
run: |-
pm2 start verdaccio -- --config $HOME/.config/verdaccio/config.yaml
sleep 5 # Wait for Verdaccio to start
- name: Configure npm to use local registry
run: |-
echo '//localhost:4873/:_authToken="MWRjNDU3OTE1NTljYWUyOTFkMWJkOGUyYTIwZWMwNTI6YTgwZjkyNDE0NzgwYWQzNQ=="' > ~/.npmrc
echo 'registry=http://localhost:4873/' >> ~/.npmrc
- name: Find an locally publish all tarballs
run: |-
for pkg in packages/{@aws-cdk/cloudformation-diff,cdk-assets,aws-cdk,@aws-cdk/cli-lib-alpha,cdk}/dist/js/*.tgz; do
npm publish $pkg
done
- name: Download and install the test artifact
run: |-
npm install @aws-cdk-testing/cli-integ
mv ./node_modules/@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:
JEST_TEST_CONCURRENT: ${{ matrix.suite == 'cli-integ-tests' && 'true' || 'false' }}
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"
AWS_REGIONS: us-east-2,eu-west-1,eu-north-1,ap-northeast-1,ap-south-1
CDK_MAJOR_VERSION: "2"
RELEASE_TAG: latest
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bin/run-suite --use-cli-release=${{ steps.versions.outputs.cli_version }} --framework-version=${{ steps.versions.outputs.lib_version }} ${{ matrix.suite }}
strategy:
fail-fast: false
matrix:
suite:
- cli-integ-tests
- init-csharp
- init-fsharp
- init-go
- init-java
- init-javascript
- init-python
- init-typescript-app
- init-typescript-lib
- tool-integrations
integ:
needs: integ_matrix
runs-on: aws-cdk_ubuntu-latest_4-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.integ_matrix.result) }}
run: exit 1