2323 runs-on : ubuntu-latest
2424 environment : e2e-testing
2525 timeout-minutes : 30
26+ env :
27+ # Single source for the AWS region default. On `workflow_dispatch` the
28+ # input applies; on other events `inputs` is empty so the fallback applies.
29+ AWS_REGION : ${{ inputs.aws_region || 'us-east-1' }}
2630 strategy :
2731 fail-fast : false
2832 matrix :
5862 uses : aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885 # v6.1.1
5963 with :
6064 role-to-assume : ${{ secrets.E2E_AWS_ROLE_ARN }}
61- aws-region : ${{ inputs.aws_region || 'us-east-1' }}
65+ aws-region : ${{ env.AWS_REGION }}
6266 - name : Get AWS Account ID
6367 id : aws
6468 run : echo "account_id=$(aws sts get-caller-identity --query Account --output text)" >> "$GITHUB_OUTPUT"
@@ -74,28 +78,39 @@ jobs:
7478 - name : Build CDK package from main
7579 if : matrix.cdk-source == 'main'
7680 run : |
81+ set -euo pipefail
82+ [ -n "${CDK_REPO_TOKEN}" ] && [ -n "${CDK_REPO}" ] || { echo "::error::CDK_REPO and CDK_REPO_TOKEN must be set"; exit 1; }
7783 git clone --depth 1 "https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git" /tmp/cdk-repo
7884 cd /tmp/cdk-repo
7985 npm ci
8086 npm run build
81- TARBALL=$(npm pack --pack-destination "$RUNNER_TEMP" | tail -1)
82- echo "CDK_TARBALL=$RUNNER_TEMP/$TARBALL" >> "$GITHUB_ENV"
87+ TARBALL="$(npm pack --json --pack-destination "$RUNNER_TEMP" | jq -r '.[0].filename')"
88+ CDK_TARBALL="$RUNNER_TEMP/$TARBALL"
89+ # Fail loud: a missing tarball would silently fall back to the published
90+ # CDK in installCdkTarball(), defeating the `main` matrix leg.
91+ [ -f "$CDK_TARBALL" ] || { echo "::error::CDK tarball not found at '$CDK_TARBALL'"; exit 1; }
92+ echo "CDK_TARBALL=$CDK_TARBALL" >> "$GITHUB_ENV"
8393 env :
8494 CDK_REPO_TOKEN : ${{ secrets.CDK_REPO_TOKEN }}
8595 CDK_REPO : ${{ secrets.CDK_REPO_NAME }}
8696
8797 - run : npm ci
8898 - run : npm run build
8999 - name : Install CLI globally
90- run : npm install -g "$(npm pack | tail -1)"
100+ run : |
101+ set -euo pipefail
102+ TARBALL="$(npm pack --json | jq -r '.[0].filename')"
103+ npm install -g "./$TARBALL"
91104 - name : Run E2E tests (${{ matrix.cdk-source }})
92105 env :
93106 AWS_ACCOUNT_ID : ${{ steps.aws.outputs.account_id }}
94- AWS_REGION : ${{ inputs.aws_region || 'us-east-1' }}
107+ AWS_REGION : ${{ env.AWS_REGION }}
95108 ANTHROPIC_API_KEY : ${{ env.E2E_ANTHROPIC_API_KEY }}
96109 OPENAI_API_KEY : ${{ env.E2E_OPENAI_API_KEY }}
97110 GEMINI_API_KEY : ${{ env.E2E_GEMINI_API_KEY }}
98111 CDK_TARBALL : ${{ env.CDK_TARBALL }}
99- # Only run Bedrock tests on PRs to avoid creating ApiKeyCredentialProviders,
100- # which have a 50-resource account limit and accumulate from interrupted runs.
112+ # This manual/dispatch workflow runs only the Bedrock subset (strands-bedrock,
113+ # langgraph-bedrock) to limit creation of ApiKeyCredentialProviders, which have a
114+ # 50-resource account limit and accumulate from interrupted runs. The full suite
115+ # runs in e2e-tests-full.yml.
101116 run : npx vitest run --project e2e strands-bedrock langgraph-bedrock
0 commit comments