|
| 1 | +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". |
| 2 | + |
| 3 | +name: build-and-integ |
| 4 | +on: |
| 5 | + pull_request_target: |
| 6 | + branches: |
| 7 | + - main |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + permissions: |
| 12 | + contents: read |
| 13 | + environment: integ-approval |
| 14 | + env: |
| 15 | + CI: "true" |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + ref: ${{ github.event.pull_request.head.sha }} |
| 21 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 22 | + fetch-depth: 0 |
| 23 | + - name: Setup Node.js |
| 24 | + uses: actions/setup-node@v4 |
| 25 | + with: |
| 26 | + node-version: lts/* |
| 27 | + - name: Install dependencies |
| 28 | + run: yarn install --check-files |
| 29 | + - name: Bump to realistic versions |
| 30 | + env: |
| 31 | + TESTING_CANDIDATE: "true" |
| 32 | + run: yarn workspaces run bump |
| 33 | + - name: build |
| 34 | + env: |
| 35 | + RELEASE: "true" |
| 36 | + run: npx projen build |
| 37 | + - name: Upload artifact |
| 38 | + uses: actions/upload-artifact@v4.4.0 |
| 39 | + with: |
| 40 | + name: build-artifact |
| 41 | + path: packages/**/dist/js/*.tgz |
| 42 | + overwrite: "true" |
| 43 | + integ: |
| 44 | + needs: build |
| 45 | + runs-on: aws-cdk_ubuntu-latest_4-core |
| 46 | + permissions: |
| 47 | + contents: read |
| 48 | + id-token: write |
| 49 | + environment: run-tests |
| 50 | + env: |
| 51 | + MAVEN_ARGS: --no-transfer-progress |
| 52 | + IS_CANARY: "true" |
| 53 | + CI: "true" |
| 54 | + CLI_LIB_VERSION_MIRRORS_CLI: "true" |
| 55 | + steps: |
| 56 | + - name: Download build artifacts |
| 57 | + uses: actions/download-artifact@v4 |
| 58 | + with: |
| 59 | + name: build-artifact |
| 60 | + path: packages |
| 61 | + - name: Set up JDK 18 |
| 62 | + if: matrix.suite == 'init-java' || matrix.suite == 'cli-integ-tests' |
| 63 | + uses: actions/setup-java@v4 |
| 64 | + with: |
| 65 | + java-version: "18" |
| 66 | + distribution: corretto |
| 67 | + - name: Authenticate Via OIDC Role |
| 68 | + id: creds |
| 69 | + uses: aws-actions/configure-aws-credentials@v4 |
| 70 | + with: |
| 71 | + aws-region: us-east-1 |
| 72 | + role-duration-seconds: 14400 |
| 73 | + role-to-assume: ${{ vars.AWS_ROLE_TO_ASSUME_FOR_TESTING }} |
| 74 | + role-session-name: run-tests@aws-cdk-cli-integ |
| 75 | + output-credentials: true |
| 76 | + - name: Set git identity |
| 77 | + run: |- |
| 78 | + git config --global user.name "aws-cdk-cli-integ" |
| 79 | + git config --global user.email "noreply@example.com" |
| 80 | + - name: Install Verdaccio |
| 81 | + run: npm install -g verdaccio pm2 |
| 82 | + - name: Create Verdaccio config |
| 83 | + run: |- |
| 84 | + mkdir -p $HOME/.config/verdaccio |
| 85 | + 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 |
| 86 | + - name: Start Verdaccio |
| 87 | + run: |- |
| 88 | + pm2 start verdaccio -- --config $HOME/.config/verdaccio/config.yaml |
| 89 | + sleep 5 # Wait for Verdaccio to start |
| 90 | + - name: Configure npm to use local registry |
| 91 | + run: |- |
| 92 | + echo '//localhost:4873/:_authToken="MWRjNDU3OTE1NTljYWUyOTFkMWJkOGUyYTIwZWMwNTI6YTgwZjkyNDE0NzgwYWQzNQ=="' > ~/.npmrc |
| 93 | + echo 'registry=http://localhost:4873/' >> ~/.npmrc |
| 94 | + - name: Find an locally publish all tarballs |
| 95 | + run: |- |
| 96 | + for pkg in packages/{@aws-cdk/cloudformation-diff,cdk-assets,aws-cdk,@aws-cdk/cli-lib-alpha,cdk}/dist/js/*.tgz; do |
| 97 | + npm publish $pkg |
| 98 | + done |
| 99 | + - name: Download and install the test artifact |
| 100 | + run: |- |
| 101 | + npm install @aws-cdk-testing/cli-integ |
| 102 | + mv ./node_modules/@aws-cdk-testing/cli-integ/* . |
| 103 | + - name: Determine latest package versions |
| 104 | + id: versions |
| 105 | + run: |- |
| 106 | + CLI_VERSION=$(cd ${TMPDIR:-/tmp} && npm view aws-cdk version) |
| 107 | + echo "CLI version: ${CLI_VERSION}" |
| 108 | + echo "cli_version=${CLI_VERSION}" >> $GITHUB_OUTPUT |
| 109 | + LIB_VERSION=$(cd ${TMPDIR:-/tmp} && npm view aws-cdk-lib version) |
| 110 | + echo "lib version: ${LIB_VERSION}" |
| 111 | + echo "lib_version=${LIB_VERSION}" >> $GITHUB_OUTPUT |
| 112 | + - name: "Run the test suite: ${{ matrix.suite }}" |
| 113 | + env: |
| 114 | + JEST_TEST_CONCURRENT: ${{ matrix.suite == 'cli-integ-tests' && 'true' || 'false' }} |
| 115 | + JSII_SILENCE_WARNING_DEPRECATED_NODE_VERSION: "true" |
| 116 | + JSII_SILENCE_WARNING_UNTESTED_NODE_VERSION: "true" |
| 117 | + JSII_SILENCE_WARNING_KNOWN_BROKEN_NODE_VERSION: "true" |
| 118 | + DOCKERHUB_DISABLED: "true" |
| 119 | + AWS_REGIONS: us-east-2,eu-west-1,eu-north-1,ap-northeast-1,ap-south-1 |
| 120 | + CDK_MAJOR_VERSION: "2" |
| 121 | + RELEASE_TAG: latest |
| 122 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 123 | + run: bin/run-suite --use-cli-release=${{ steps.versions.outputs.cli_version }} --framework-version=${{ steps.versions.outputs.lib_version }} ${{ matrix.suite }} |
| 124 | + strategy: |
| 125 | + fail-fast: false |
| 126 | + matrix: |
| 127 | + suite: |
| 128 | + - cli-integ-tests |
| 129 | + - init-csharp |
| 130 | + - init-fsharp |
| 131 | + - init-go |
| 132 | + - init-java |
| 133 | + - init-javascript |
| 134 | + - init-python |
| 135 | + - init-typescript-app |
| 136 | + - init-typescript-lib |
| 137 | + - tool-integrations |
0 commit comments