@@ -19,6 +19,8 @@ permissions:
1919jobs :
2020 gate :
2121 runs-on : ubuntu-latest-low
22+ outputs :
23+ run-playwright : ${{ steps.gate-e2e.outputs.run-playwright }}
2224 steps :
2325 - name : Evaluate e2e tests execution conditions
2426 id : gate-e2e
@@ -39,17 +41,20 @@ jobs:
3941 })
4042 const playwrightTouched = files.some((file) => file.filename.startsWith('tests/playwright'))
4143
42- if (hasForceLabel || hasToReviewLabel || hasToReleaseLabel || playwrightTouched) {
43- return
44- } else {
45- core.setFailed('Skipping Playwright: draft state, missing labels or no playwright path changes.')
44+ const shouldRun = hasForceLabel || hasToReviewLabel || hasToReleaseLabel || playwrightTouched
45+
46+ core.setOutput('run-playwright', shouldRun ? 'true' : 'false')
47+
48+ if (!shouldRun) {
49+ core.notice('Skipping Playwright: missing labels and no playwright path changes.')
4650 }
4751
4852 playwright-setup :
4953 timeout-minutes : 15
5054 name : Playwright setup
5155 runs-on : ubuntu-latest
5256 needs : gate
57+ if : needs.gate.outputs.run-playwright == 'true'
5358 steps :
5459 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5560 with :
7984 timeout-minutes : 60
8085 name : Playwright tests ${{ matrix.shardIndex }} / ${{ matrix.shardTotal }}
8186 runs-on : ubuntu-latest
87+ if : needs.gate.outputs.run-playwright == 'true'
8288 strategy :
8389 fail-fast : false
8490 matrix :
@@ -149,6 +155,7 @@ jobs:
149155 timeout-minutes : 30
150156 name : Playwright tests for installer
151157 runs-on : ubuntu-latest
158+ if : needs.gate.outputs.run-playwright == 'true'
152159
153160 # The installation-wizard tests exercise every supported database backend, so
154161 # they need reachable database service containers. The Nextcloud container is
@@ -255,7 +262,7 @@ jobs:
255262
256263 merge-reports :
257264 # Merge reports after playwright-tests, even if some shards have failed
258- if : ${{ !cancelled() }}
265+ if : ${{ !cancelled() && needs.gate.outputs.run-playwright == 'true' }}
259266 needs : [gate, playwright-tests, playwright-installer-tests]
260267
261268 runs-on : ubuntu-latest-low
@@ -319,5 +326,10 @@ jobs:
319326 name : playwright-test-summary
320327
321328 steps :
329+ - name : Skip summary when Playwright is not required
330+ if : needs.gate.outputs.run-playwright != 'true'
331+ run : echo 'Playwright skipped for this pull request.'
332+
322333 - name : Summary status
334+ if : needs.gate.outputs.run-playwright == 'true'
323335 run : if ${{ needs.playwright-tests.result != 'success' || needs.playwright-installer-tests.result != 'success' }}; then exit 1; fi
0 commit comments