Skip to content

Commit

Permalink
SWC-6624: update conditional and concurrency to handle forked repo
Browse files Browse the repository at this point in the history
  • Loading branch information
hallieswan committed Dec 12, 2023
1 parent 1af9a1f commit d939299
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ jobs:
needs: [build]
runs-on: 'macos-latest'
timeout-minutes: 60
# Ensure that at most one playwright-tests job will run at a time
# Ensure that at most one playwright-tests job will run at a time in Sage-Bionetworks repo,
# but allow multiple playwright-test jobs to run concurrently in forked repos
# Per https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
# "When a concurrent job or workflow is queued, if another job or workflow
# using the same concurrency group in the repository is in progress,
# the queued job or workflow will be pending. Any previously pending job or
# workflow in the concurrency group will be cancelled."
# Related discussion here: https://github.com/orgs/community/discussions/5435
concurrency:
group: ${{ github.workflow }}-playwright-tests
group: ${{ github.repository_owner == 'Sage-Bionetworks' && format('${0}-${1}', github.workflow, '-playwright-tests') || format('${0}-${1}', github.run_id, matrix.shard ) }}
strategy:
max-parallel: ${{ github.repository_owner == 'Sage-Bionetworks' && 1 || 3 }}
fail-fast: false
Expand All @@ -46,7 +47,6 @@ jobs:
CI: true
DESTINATION_BUCKET: e2e-reports-bucket-bucket-1p1qz6p48t4uy
REPORT_ID: ${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}
IS_SAGE_REPO: ${{ github.repository_owner == 'Sage-Bionetworks' }}
# Allow OIDC Integration (so we can assume the AWS role to deploy)
permissions:
id-token: write
Expand Down Expand Up @@ -82,23 +82,23 @@ jobs:
- name: Run Playwright tests
env:
ADMIN_PAT: ${{ secrets.ADMIN_PAT }}
TRACE_TOGGLE: ${{ env.IS_SAGE_REPO && 'on' || 'off'}}
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'
uses: aws-actions/configure-aws-credentials@v2
if: ${{ env.IS_SAGE_REPO }}
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::449435941126:role/sagebase-github-oidc-synapsedev-e2e-infra
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: ${{ env.IS_SAGE_REPO }}
if: github.repository_owner == 'Sage-Bionetworks'
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
uses: actions/upload-artifact@v3
if: ${{ !env.IS_SAGE_REPO && always() }}
if: ${{ github.repository_owner != 'Sage-Bionetworks' && always() }}
with:
name: ${{ env.PW_ALL_BLOBS_DIR }}
path: blob-report
Expand Down

0 comments on commit d939299

Please sign in to comment.