n8n/.github/workflows/e2e-tests-pr.yml
OlegIvaniv 60d28fc761
ci: Prevent skipping of E2E fail job (no-changelog) (#5958)
* ci: Prevent skipping of E2E fail job (no-changelog)

* Set `continue-on-error: true` for e2e-reusable and add fail job

* Always run e2e checks

* Update 1-workflows.cy.ts

---------

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2023-04-12 14:13:42 +02:00

63 lines
1.9 KiB
YAML

name: PR E2E
on:
pull_request_review:
types: [submitted]
branch:
- 'master'
jobs:
# We disable this for now because cancelling runs makes the Cypress Cloud tests to hang.
# cancel-previous-runs:
# runs-on: ubuntu-latest
# name: 'Cancel previous e2e test runs'
# strategy:
# matrix:
# node-version: [16.x]
# steps:
# - name: 'Cancel previous runs'
# uses: styfle/cancel-workflow-action@0.9.0
# with:
# access_token: ${{ github.token }}
run-e2e-tests:
name: E2E [Electron/Node 16]
uses: ./.github/workflows/e2e-reusable.yml
if: ${{ github.event.review.state == 'approved' }}
with:
branch: ${{ github.event.pull_request.head.ref }}
user: ${{ github.event.pull_request.user.login || 'PR User' }}
spec: 'e2e/*'
run-env: base:16.18.1
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
post-e2e-tests:
runs-on: ubuntu-latest
name: E2E [Electron/Node 16] - Checks
needs: [run-e2e-tests]
if: always()
steps:
- name: E2E success comment
if: needs.run-e2e-tests.result == 'success'
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: Fail job if run-e2e-tests failed
if: needs.run-e2e-tests.result == 'failure'
run: exit 1