|
1 | 1 | name: Run Playwright Tests |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: # Internal runs |
5 | | - workflow_call: # Allows a caller to run this against a fork/community PR |
| 4 | + push: # keeps existing internal runs |
| 5 | + workflow_call: # allows a caller to run this against a fork PR |
6 | 6 | inputs: |
7 | 7 | pr_repo: |
8 | 8 | type: string |
|
18 | 18 | required: false |
19 | 19 | default: '["runs-on","runner=32cpu-linux-x64","disk=large","run-id=${{ github.run_id }}"]' |
20 | 20 |
|
| 21 | +permissions: |
| 22 | + contents: read |
| 23 | + |
21 | 24 | concurrency: |
22 | | - group: Run-Playwright-Tests-${{ github.workflow }}-${{ github.head_ref || github.event.workflow_run.head_branch || github.run_id }} |
| 25 | + group: Run-Playwright-Tests-${{ github.workflow }}-${{ inputs.pr_sha || github.head_ref || (github.event_name == 'workflow_run' && github.event.workflow_run.head_branch) || github.ref_name || github.run_id }} |
23 | 26 | cancel-in-progress: true |
24 | | - |
| 27 | + |
25 | 28 | env: |
26 | | - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
27 | | - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
28 | | - GEN_AI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
29 | 29 | MOCK_LLM_RESPONSE: true |
30 | 30 | PYTEST_PLAYWRIGHT_SKIP_INITIAL_RESET: true |
31 | 31 |
|
32 | 32 | jobs: |
33 | 33 | playwright-tests: |
34 | 34 | name: Playwright Tests |
| 35 | + runs-on: ${{ inputs.runner }} |
| 36 | + |
| 37 | + # Secrets come from the caller (via `secrets: inherit`) |
| 38 | + env: |
| 39 | + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 40 | + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
| 41 | + GEN_AI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 42 | + # Vars (non-secret) pulled from repo/org vars: |
| 43 | + RUNS_ON_AWS_REGION: ${{ vars.RUNS_ON_AWS_REGION }} |
| 44 | + RUNS_ON_S3_BUCKET_CACHE: ${{ vars.RUNS_ON_S3_BUCKET_CACHE }} |
35 | 45 |
|
36 | | - # See https://runs-on.com/runners/linux/ |
37 | | - runs-on: |
38 | | - [ |
39 | | - runs-on, |
40 | | - runner=32cpu-linux-x64, |
41 | | - disk=large, |
42 | | - "run-id=${{ github.run_id }}", |
43 | | - ] |
44 | 46 | steps: |
45 | 47 | - name: Checkout code |
46 | 48 | uses: actions/checkout@v4 |
47 | 49 | with: |
| 50 | + repository: ${{ inputs.pr_repo }} |
| 51 | + ref: ${{ inputs.pr_sha }} |
48 | 52 | fetch-depth: 0 |
| 53 | + persist-credentials: false |
49 | 54 |
|
50 | 55 | - name: Set up Python |
51 | 56 | uses: actions/setup-python@v5 |
|
0 commit comments