mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
32ddb4d04b
This should help us reduce the load on CI workers to some extend.
56 lines
1.9 KiB
YAML
56 lines
1.9 KiB
YAML
name: PR E2E
|
|
|
|
on:
|
|
pull_request_review:
|
|
types: [submitted]
|
|
branch:
|
|
- 'master'
|
|
|
|
concurrency:
|
|
group: e2e-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
run-e2e-tests:
|
|
name: E2E [Electron/Node 18]
|
|
uses: ./.github/workflows/e2e-reusable.yml
|
|
if: ${{ github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'community') }}
|
|
with:
|
|
pr_number: ${{ github.event.pull_request.number }}
|
|
user: ${{ github.event.pull_request.user.login || 'PR User' }}
|
|
spec: 'e2e/*'
|
|
secrets:
|
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
|
|
post-e2e-tests:
|
|
runs-on: ubuntu-latest
|
|
name: E2E [Electron/Node 18] - Checks
|
|
needs: [run-e2e-tests]
|
|
if: always()
|
|
steps:
|
|
- name: E2E success comment
|
|
if: ${{!contains(github.event.pull_request.labels.*.name, 'community') && needs.run-e2e-tests.outputs.tests_passed == 'true' }}
|
|
uses: peter-evans/create-or-update-comment@v3
|
|
with:
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
body: |
|
|
:white_check_mark: All Cypress E2E specs passed
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: E2E fail comment
|
|
if: needs.run-e2e-tests.result == 'failure'
|
|
uses: peter-evans/create-or-update-comment@v3
|
|
with:
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
body: |
|
|
:warning: Some Cypress E2E specs are failing, please fix them before merging
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Success job if community PR
|
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'community') }}
|
|
run: exit 0
|
|
|
|
- name: Fail job if run-e2e-tests failed
|
|
if: ${{ (github.event.review.state != 'approved' && github.event.review.state != 'commented') || needs.run-e2e-tests.result == 'failure' }}
|
|
run: exit 1
|