From 33fe83fa2cbf4dd4634a1dff05e12a600f515507 Mon Sep 17 00:00:00 2001 From: Hallie Swan <26949006+hallieswan@users.noreply.github.com> Date: Wed, 13 Dec 2023 11:58:41 -0800 Subject: [PATCH] SWC-6624: ensure that build was successfully downloaded before running e2e tests, ensure that e2e report is pushed to s3 even if playwright tests fail --- .github/workflows/build-test-e2e.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-e2e.yml b/.github/workflows/build-test-e2e.yml index 104a673b82..e3170189b9 100644 --- a/.github/workflows/build-test-e2e.yml +++ b/.github/workflows/build-test-e2e.yml @@ -63,6 +63,12 @@ jobs: with: name: ${{ env.BUILD_ARTIFACT_NAME }} path: ${{ env.BUILD_DIR }} + - name: Confirm build downloaded + run: | + if [ ! -f "/$(pwd)/${{ env.BUILD_DIR }}/${{ env.BUILD_NAME }}" ]; then + echo "::error ::downloaded WAR not found" + exit 1 + fi - name: Run SWC on Tomcat run: | docker run \ @@ -85,7 +91,7 @@ jobs: TRACE_TOGGLE: ${{ github.repository_owner == 'Sage-Bionetworks' && 'on' || 'off'}} run: yarn playwright test --shard ${{ matrix.shard }} --trace=${{ env.TRACE_TOGGLE }} - name: Assume AWS Role - if: github.repository_owner == 'Sage-Bionetworks' + if: ${{ github.repository_owner == 'Sage-Bionetworks' && always() }} uses: aws-actions/configure-aws-credentials@v2 with: aws-region: us-east-1 @@ -93,7 +99,7 @@ jobs: role-session-name: GitHubActions-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }} role-duration-seconds: 1200 - name: Upload blob report to S3 - if: github.repository_owner == 'Sage-Bionetworks' + if: ${{ github.repository_owner == 'Sage-Bionetworks' && always() }} run: | aws s3 sync ./blob-report --region us-east-1 s3://${{ env.DESTINATION_BUCKET }}/${{ env.REPORT_ID }}/ - name: Upload blob report to GitHub Actions Artifacts