|
1 | 1 | name: samcli-vm |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - branches: |
6 | | - - main |
7 | 4 | schedule: |
8 | 5 | - cron: '0 8 * * *' |
9 | 6 | workflow_dispatch: |
@@ -138,6 +135,7 @@ jobs: |
138 | 135 | role-to-assume: ${{ secrets.SAMCLI_VM_ROLE_SYNC }} |
139 | 136 | role-session-name: samcli-finch-vm-sequential-tests |
140 | 137 | aws-region: ${{ secrets.REGION }} |
| 138 | + role-duration-seconds: 14400 |
141 | 139 |
|
142 | 140 | - name: Install Docker CLI for SAM CLI compatibility |
143 | 141 | run: | |
@@ -172,34 +170,50 @@ jobs: |
172 | 170 |
|
173 | 171 | - name: Run unit tests |
174 | 172 | continue-on-error: true |
175 | | - run: ./scripts/samcli-vm/run-unit-tests.sh |
| 173 | + run: | |
| 174 | + ./scripts/samcli-vm/run-unit-tests.sh |
| 175 | + echo "UNIT_EXIT_CODE=$(cat /tmp/unit_exit_code 2>/dev/null || echo 1)" >> $GITHUB_ENV |
176 | 176 |
|
177 | 177 | - name: Run sync tests |
178 | 178 | continue-on-error: true |
179 | | - run: ./scripts/samcli-vm/run-sync-tests.sh |
| 179 | + run: | |
| 180 | + ./scripts/samcli-vm/run-sync-tests.sh |
| 181 | + echo "SYNC_EXIT_CODE=$(cat /tmp/sync_exit_code 2>/dev/null || echo 1)" >> $GITHUB_ENV |
180 | 182 |
|
181 | 183 | - name: Run package tests |
182 | 184 | continue-on-error: true |
183 | | - run: ./scripts/samcli-vm/run-package-tests.sh |
| 185 | + run: | |
| 186 | + ./scripts/samcli-vm/run-package-tests.sh |
| 187 | + echo "PACKAGE_EXIT_CODE=$(cat /tmp/package_exit_code 2>/dev/null || echo 1)" >> $GITHUB_ENV |
184 | 188 |
|
185 | 189 | - name: Run start-api tests |
186 | 190 | continue-on-error: true |
187 | | - run: ./scripts/samcli-vm/run-start-api-tests.sh |
| 191 | + run: | |
| 192 | + ./scripts/samcli-vm/run-start-api-tests.sh |
| 193 | + echo "START_API_EXIT_CODE=$(cat /tmp/start_api_exit_code 2>/dev/null || echo 1)" >> $GITHUB_ENV |
188 | 194 |
|
189 | 195 | - name: Run start-lambda tests |
190 | 196 | continue-on-error: true |
191 | | - run: ./scripts/samcli-vm/run-start-lambda-tests.sh |
| 197 | + run: | |
| 198 | + ./scripts/samcli-vm/run-start-lambda-tests.sh |
| 199 | + echo "START_LAMBDA_EXIT_CODE=$(cat /tmp/start_lambda_exit_code 2>/dev/null || echo 1)" >> $GITHUB_ENV |
192 | 200 |
|
193 | 201 | - name: Patch SAM CLI for Docker image cleanup |
194 | 202 | continue-on-error: true |
195 | 203 | run: | |
196 | 204 | # Apply git patch to handle ImageNotFound exceptions for all Docker tests |
197 | 205 | su ec2-user -c 'cd /Users/ec2-user/aws-sam-cli && git apply ${{ github.workspace }}/scripts/samcli-vm/invoke-teardown.patch' |
| 206 | + echo "PATCH_EXIT_CODE=$?" >> $GITHUB_ENV |
198 | 207 | shell: bash |
199 | 208 |
|
200 | 209 | - name: Run invoke tests |
201 | 210 | continue-on-error: true |
202 | | - run: ./scripts/samcli-vm/run-invoke-tests.sh |
| 211 | + run: | |
| 212 | + ./scripts/samcli-vm/run-invoke-tests.sh |
| 213 | + echo "INVOKE_EXIT_CODE=$(cat /tmp/invoke_exit_code 2>/dev/null || echo 1)" >> $GITHUB_ENV |
| 214 | +
|
| 215 | + - name: Check test results |
| 216 | + run: ./scripts/samcli-vm/check-test-results.sh |
203 | 217 |
|
204 | 218 | # ensuring resources are clean post-test |
205 | 219 | cleanup: |
|
0 commit comments