|
1 | 1 | name: Integration Test deployment (Auto) |
2 | 2 |
|
3 | | -# Privileged workflow that runs integration tests when triggered by the |
4 | | -# "Integration Test Auto Trigger" workflow. Uses workflow_run to run in the |
5 | | -# base repo context with access to secrets, vars, and OIDC. |
6 | | -# |
7 | | -# SHADOW MODE: Failures don't block PR merges. |
8 | | -# Once validated, this will replace the label-based workflow (integration-test-deployment.yml). |
| 3 | +# ⚠️ FORK TEST VERSION — DO NOT MERGE |
| 4 | +# Stubbed for testing the workflow_run artifact handoff on a fork. |
| 5 | +# Real version: see commit 49066b8463 |
9 | 6 |
|
10 | 7 | on: |
11 | 8 | workflow_run: |
@@ -44,103 +41,43 @@ jobs: |
44 | 41 | echo "base_sha=$(cat pr/base_sha)" >> "$GITHUB_OUTPUT" |
45 | 42 | echo "reviewer=$(cat pr/reviewer)" >> "$GITHUB_OUTPUT" |
46 | 43 | echo "has_snapshots=$(cat pr/has_snapshots)" >> "$GITHUB_OUTPUT" |
| 44 | + echo "::notice::PR #$(cat pr/pr_number) | head=$(cat pr/head_sha) | base=$(cat pr/base_sha) | reviewer=$(cat pr/reviewer) | snapshots=$(cat pr/has_snapshots)" |
47 | 45 |
|
| 46 | + # FORK TEST: Skip real team check, just validate the handoff worked |
48 | 47 | validate-approver: |
49 | 48 | needs: download-pr-info |
50 | 49 | if: needs.download-pr-info.outputs.has_snapshots == 'true' |
51 | 50 | runs-on: ubuntu-latest |
52 | 51 | outputs: |
53 | 52 | is_member: ${{ steps.check_team.outputs.is_member }} |
54 | 53 | steps: |
55 | | - - name: Check if approver is CDK team member |
| 54 | + - name: "FORK TEST: Stub team check" |
56 | 55 | id: check_team |
57 | | - env: |
58 | | - GITHUB_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }} |
59 | | - APPROVER: ${{ needs.download-pr-info.outputs.reviewer }} |
60 | 56 | run: | |
61 | | - if gh api "orgs/aws/teams/aws-cdk-team/memberships/${APPROVER}" --jq '.state' 2>/dev/null | grep -q "active"; then |
62 | | - echo "${APPROVER} is an active CDK team member" |
63 | | - echo "is_member=true" >> $GITHUB_OUTPUT |
64 | | - else |
65 | | - echo "${APPROVER} is not a CDK team member or membership is not active" |
66 | | - echo "is_member=false" >> $GITHUB_OUTPUT |
67 | | - fi |
| 57 | + echo "::notice::FORK TEST — skipping real team check for reviewer: ${{ needs.download-pr-info.outputs.reviewer }}" |
| 58 | + echo "is_member=true" >> $GITHUB_OUTPUT |
68 | 59 |
|
| 60 | + # FORK TEST: Replace deployment with a summary of what would run |
69 | 61 | integration_test_deployment_auto: |
70 | 62 | needs: [download-pr-info, validate-approver] |
71 | 63 | if: needs.validate-approver.outputs.is_member == 'true' |
72 | | - runs-on: codebuild-aws-cdk-github-actions-deployment-integ-runner-${{ github.run_id }}-${{ github.run_attempt }} |
73 | | - # Shadow mode: workflow reports success even if tests fail |
| 64 | + runs-on: ubuntu-latest |
74 | 65 | continue-on-error: true |
75 | 66 | name: 'Deploy integration test snapshots (Auto)' |
76 | | - |
77 | | - permissions: |
78 | | - id-token: write # Required for OIDC authentication with AWS Atmosphere |
79 | | - contents: read |
80 | | - |
81 | | - env: |
82 | | - PR_BUILD: true |
83 | | - |
84 | 67 | steps: |
85 | | - - name: Checkout HEAD |
86 | | - uses: actions/checkout@v6 |
87 | | - with: |
88 | | - ref: ${{ needs.download-pr-info.outputs.head_sha }} |
89 | | - fetch-depth: 0 |
90 | | - |
91 | | - - name: Setup Node.js |
92 | | - uses: actions/setup-node@v6 |
93 | | - with: |
94 | | - node-version: "lts/*" |
95 | | - cache: "yarn" |
96 | | - cache-dependency-path: | |
97 | | - yarn.lock |
98 | | -
|
99 | | - - name: Set up Docker |
100 | | - uses: docker/setup-buildx-action@v4 |
101 | | - |
102 | | - - name: Load Docker images |
103 | | - id: docker-cache |
104 | | - uses: actions/cache/restore@v5 |
105 | | - with: |
106 | | - path: | |
107 | | - ~/.docker-images.tar |
108 | | - key: docker-cache-${{ runner.os }} |
109 | | - |
110 | | - - name: Restore Docker images |
111 | | - if: ${{ steps.docker-cache.outputs.cache-hit }} |
112 | | - run: docker image load --input ~/.docker-images.tar |
113 | | - |
114 | | - - name: Cache build artifacts |
115 | | - uses: actions/cache@v5 |
116 | | - with: |
117 | | - path: | |
118 | | - ~/.s3buildcache |
119 | | - key: s3buildcache-${{ runner.os }} |
120 | | - |
121 | | - - name: Configure system settings |
| 68 | + - name: "FORK TEST: Deployment stub" |
122 | 69 | run: | |
123 | | - (command -v sysctl || sudo apt-get update && sudo apt-get install -y procps) && \ |
124 | | - sudo sysctl -w vm.max_map_count=2251954 |
125 | | -
|
126 | | - - name: Install dependencies for Integration Tests |
127 | | - run: yarn install --frozen-lockfile |
128 | | - |
129 | | - - name: Build deployment-integ |
130 | | - run: yarn --cwd tools/@aws-cdk/integration-test-deployment build |
131 | | - |
132 | | - - name: Build Integration Test packages |
133 | | - run: npx lerna run build --scope="{@aws-cdk/*,@aws-cdk-testing/framework-integ}" |
134 | | - |
135 | | - - name: Run integration tests |
136 | | - run: yarn run atmosphere-integ-test |
137 | | - env: |
138 | | - CDK_ATMOSPHERE_ENDPOINT: ${{ vars.CDK_ATMOSPHERE_ENDPOINT }} |
139 | | - CDK_ATMOSPHERE_POOL: ${{ vars.CDK_ATMOSPHERE_POOL }} |
140 | | - CDK_ATMOSPHERE_OIDC_ROLE: ${{ vars.CDK_ATMOSPHERE_OIDC_ROLE }} |
141 | | - CDK_ATMOSPHERE_BATCH_SIZE: ${{ vars.CDK_ATMOSPHERE_BATCH_SIZE }} |
142 | | - TARGET_BRANCH_COMMIT: ${{ needs.download-pr-info.outputs.base_sha }} |
143 | | - SOURCE_BRANCH_COMMIT: ${{ needs.download-pr-info.outputs.head_sha }} |
144 | | - GITHUB_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }} |
145 | | - GITHUB_REPOSITORY: ${{ github.repository }} |
146 | | - PR_NUMBER: ${{ needs.download-pr-info.outputs.pr_number }} |
| 70 | + echo "=========================================" |
| 71 | + echo " FORK TEST — Full chain validated! ✅" |
| 72 | + echo "=========================================" |
| 73 | + echo "" |
| 74 | + echo "PR Number: ${{ needs.download-pr-info.outputs.pr_number }}" |
| 75 | + echo "Head SHA: ${{ needs.download-pr-info.outputs.head_sha }}" |
| 76 | + echo "Base SHA: ${{ needs.download-pr-info.outputs.base_sha }}" |
| 77 | + echo "Reviewer: ${{ needs.download-pr-info.outputs.reviewer }}" |
| 78 | + echo "Snapshots: ${{ needs.download-pr-info.outputs.has_snapshots }}" |
| 79 | + echo "" |
| 80 | + echo "In production, this job would:" |
| 81 | + echo " 1. Run on codebuild runner" |
| 82 | + echo " 2. Authenticate via OIDC to AWS Atmosphere" |
| 83 | + echo " 3. Build and deploy integration tests" |
0 commit comments