Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 6 additions & 47 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@

name: Playwright Tests

on:
pull_request:
branches:
- master
- stable33
types:
- opened
- synchronize
- reopened
- ready_for_review
- labeled
on: pull_request

permissions:
contents: read
Expand All @@ -27,41 +17,10 @@ env:
BRANCH: ${{ github.base_ref || github.ref_name }}

jobs:
gate:
runs-on: ubuntu-latest-low
steps:
- name: Evaluate e2e tests execution conditions
id: gate-e2e
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const pr = context.payload.pull_request

const hasForceLabel = pr.labels.some((label) => label.name === 'force-e2e-tests')
const hasToReviewLabel = pr.labels.some((label) => label.name === '3. to review')
const hasToReleaseLabel = pr.labels.some((label) => label.name === '4. to release')

if (hasForceLabel || hasToReviewLabel || hasToReleaseLabel) {
return
}

const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
per_page: 100,
})
const playwrightTouched = files.some((file) => file.filename.startsWith('tests/playwright'))

if (!playwrightTouched) {
core.setFailed('Skipping Playwright: draft state, missing labels or no playwright path changes.')
}

playwright-setup:
timeout-minutes: 15
name: Playwright setup
runs-on: ubuntu-latest
needs: gate
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -87,7 +46,7 @@ jobs:
path: ./

playwright-tests:
needs: [gate, playwright-setup]
needs: [playwright-setup]
timeout-minutes: 60
name: Playwright tests ${{ matrix.shardIndex }} / ${{ matrix.shardTotal }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -157,7 +116,7 @@ jobs:
retention-days: 1

playwright-installer-tests:
needs: [gate, playwright-setup]
needs: [playwright-setup]
timeout-minutes: 30
name: Playwright tests for installer
runs-on: ubuntu-latest
Expand Down Expand Up @@ -267,8 +226,8 @@ jobs:

merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
if: ${{ !cancelled() && needs.gate.result == 'success' }}
needs: [gate, playwright-tests, playwright-installer-tests]
if: ${{ !cancelled() }}
needs: [playwright-tests, playwright-installer-tests]

runs-on: ubuntu-latest-low
steps:
Expand Down Expand Up @@ -324,7 +283,7 @@ jobs:
permissions:
contents: none
runs-on: ubuntu-latest-low
needs: [gate, playwright-tests, playwright-installer-tests]
needs: [playwright-tests, playwright-installer-tests]

if: always()

Expand Down
Loading