n8n/.github/workflows/e2e-tests-pr.yml

43 lines
1.3 KiB
YAML

name: PR E2E
on:
pull_request_review:
types: [submitted]
workflow_dispatch:
concurrency:
group: e2e-${{ github.event.pull_request.number || github.ref }}-${{github.event.review.state}}
cancel-in-progress: true
jobs:
eligibility_check:
name: Check Eligibility for Test Run
if: github.event_name == 'pull_request_review' && github.event.review.state == 'approved'
uses: ./.github/workflows/check-run-eligibility.yml
with:
is_pr_approved_by_maintainer: true
run-playwright-tests:
name: Playwright
uses: ./.github/workflows/playwright-test-reusable.yml
needs: [eligibility_check]
# Run for approved PRs or manual triggers
if: |
always() &&
((github.event_name == 'pull_request_review' && needs.eligibility_check.outputs.should_run == 'true') ||
(github.event_name == 'workflow_dispatch'))
secrets: inherit
post-e2e-tests:
name: E2E - Checks
runs-on: ubuntu-latest
needs: [eligibility_check, run-playwright-tests]
if: |
always() &&
((github.event_name == 'pull_request_review' && needs.eligibility_check.result != 'skipped') ||
(github.event_name == 'workflow_dispatch'))
steps:
- name: Fail if tests failed
if: needs.run-playwright-tests.result == 'failure'
run: exit 1