feat(cli): add cdk deploy --method=execute-change-set for two-step deployment workflows
#4785
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". | |
| name: integ | |
| on: | |
| pull_request_target: | |
| branches: [] | |
| merge_group: {} | |
| workflow_dispatch: {} | |
| jobs: | |
| determine_env: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| env_name: ${{ steps.output.outputs.env_name }} | |
| steps: | |
| - name: Start requiring approval | |
| run: echo integ-approval > .envname | |
| - name: Skip approval for mergeGroup or PR created from this repo | |
| if: ${{ github.event_name == 'merge_group' || github.event.pull_request.head.repo.full_name == github.repository }} | |
| run: echo no-approval > .envname | |
| - name: Output the value | |
| id: output | |
| run: echo "env_name=$(cat .envname)" >> "$GITHUB_OUTPUT" | |
| prepare: | |
| needs: determine_env | |
| runs-on: aws-cdk_ubuntu-latest_16-core | |
| permissions: | |
| contents: read | |
| environment: ${{ needs.determine_env.outputs.env_name }} | |
| env: | |
| CI: "true" | |
| DEBUG: "true" | |
| TESTING_CDK: "1" | |
| NO_UNIT_TESTS: "1" | |
| 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: Enable corepack | |
| run: corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| package-manager-cache: false | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Bump to realistic versions | |
| env: | |
| TESTING_CANDIDATE: "true" | |
| run: yarn projen run bump | |
| - name: build | |
| env: | |
| RELEASE: "true" | |
| run: yarn 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 | |
| integ_cli: | |
| needs: prepare | |
| runs-on: aws-cdk_ubuntu-latest_16-core | |
| permissions: | |
| contents: read | |
| id-token: write | |
| environment: run-tests | |
| env: | |
| NODE_NO_WARNINGS: "1" | |
| 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 --shard="${{ matrix.shard }}/12" --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 }}-${{ matrix.shard }} | |
| 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: | |
| suite: | |
| - cli-integ-tests | |
| node: | |
| - lts/* | |
| shard: | |
| - 1 | |
| - 2 | |
| - 3 | |
| - 4 | |
| - 5 | |
| - 6 | |
| - 7 | |
| - 8 | |
| - 9 | |
| - 10 | |
| - 11 | |
| - 12 | |
| integ_toolkit-lib: | |
| needs: prepare | |
| runs-on: aws-cdk_ubuntu-latest_16-core | |
| permissions: | |
| contents: read | |
| id-token: write | |
| environment: run-tests | |
| env: | |
| NODE_NO_WARNINGS: "1" | |
| 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: | |
| suite: | |
| - toolkit-lib-integ-tests | |
| node: | |
| - lts/* | |
| - 18.17.0 | |
| - "20" | |
| - "22" | |
| - "24" | |
| integ_telemetry: | |
| needs: prepare | |
| runs-on: aws-cdk_ubuntu-latest_16-core | |
| permissions: | |
| contents: read | |
| id-token: write | |
| environment: run-tests | |
| env: | |
| NODE_NO_WARNINGS: "1" | |
| 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: | |
| suite: | |
| - telemetry-integ-tests | |
| node: | |
| - lts/* | |
| integ_init-templates: | |
| needs: prepare | |
| runs-on: aws-cdk_ubuntu-latest_16-core | |
| permissions: | |
| contents: read | |
| id-token: write | |
| environment: run-tests | |
| env: | |
| NODE_NO_WARNINGS: "1" | |
| 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: | |
| - init-csharp | |
| - init-fsharp | |
| - init-go | |
| - init-java | |
| - init-javascript | |
| - init-python | |
| - init-typescript-app | |
| - init-typescript-lib | |
| node: | |
| - lts/* | |
| integ_tool-integrations: | |
| needs: prepare | |
| runs-on: aws-cdk_ubuntu-latest_16-core | |
| permissions: | |
| contents: read | |
| id-token: write | |
| environment: run-tests | |
| env: | |
| NODE_NO_WARNINGS: "1" | |
| 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: | |
| suite: | |
| - tool-integrations | |
| node: | |
| - "20" | |
| integ: | |
| needs: | |
| - integ_cli | |
| - integ_toolkit-lib | |
| - integ_telemetry | |
| - integ_init-templates | |
| - integ_tool-integrations | |
| runs-on: ubuntu-latest | |
| permissions: {} | |
| if: always() | |
| steps: | |
| - name: integ_cli result | |
| run: echo ${{ needs.integ_cli.result }} | |
| - name: integ_toolkit-lib result | |
| run: echo ${{ needs.integ_toolkit-lib.result }} | |
| - name: integ_telemetry result | |
| run: echo ${{ needs.integ_telemetry.result }} | |
| - name: integ_init-templates result | |
| run: echo ${{ needs.integ_init-templates.result }} | |
| - name: integ_tool-integrations result | |
| run: echo ${{ needs.integ_tool-integrations.result }} | |
| - name: Set status based on test results | |
| if: ${{ !(contains(fromJSON('["success", "skipped"]'), needs.integ_cli.result) && contains(fromJSON('["success", "skipped"]'), needs.integ_toolkit-lib.result) && contains(fromJSON('["success", "skipped"]'), needs.integ_telemetry.result) && contains(fromJSON('["success", "skipped"]'), needs.integ_init-templates.result) && contains(fromJSON('["success", "skipped"]'), needs.integ_tool-integrations.result)) }} | |
| run: exit 1 |