Files
n8n-enterprise-unlocked/.github/workflows/e2e-tests-pr.yml
कारतोफ्फेलस्क्रिप्ट™ 3bdbdfe6ce ci: Drop support for Node.js 18 (#15146)
2025-06-04 15:54:57 +02:00

80 lines
3.0 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: PR E2E
on:
pull_request_review:
types: [submitted]
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.review.state == 'approved'
uses: ./.github/workflows/check-run-eligibility.yml
with:
is_pr_approved_by_maintainer: true
run-e2e-tests:
name: E2E
uses: ./.github/workflows/e2e-reusable.yml
needs: [eligibility_check]
if: needs.eligibility_check.outputs.should_run == 'true'
with:
pr_number: ${{ github.event.pull_request.number }}
user: ${{ github.event.pull_request.user.login || 'PR User' }}
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
post-e2e-tests:
name: E2E - Checks
runs-on: ubuntu-latest
needs: [eligibility_check, run-e2e-tests]
if: always() && needs.eligibility_check.result != 'skipped'
steps:
- name: Determine Outcome and Comment Message
id: determine_outcome
run: |
JOB_OUTCOME="success"
COMMENT_BODY=""
SHOULD_POST_COMMENT="false"
if [[ "${{ needs.eligibility_check.outputs.should_run }}" == "false" ]]; then
COMMENT_BODY=" E2E tests were not run for this PR based on the eligibility criteria."
SHOULD_POST_COMMENT="true"
JOB_OUTCOME="success"
elif [[ "${{ needs.run-e2e-tests.result }}" == "success" ]]; then
COMMENT_BODY=":white_check_mark: All Cypress E2E specs passed"
SHOULD_POST_COMMENT="true"
JOB_OUTCOME="success"
elif [[ "${{ needs.run-e2e-tests.result }}" == "failure" ]]; then
COMMENT_BODY=":warning: Some Cypress E2E specs are failing, please fix them before merging"
SHOULD_POST_COMMENT="true"
JOB_OUTCOME="failure"
else
COMMENT_BODY=" E2E tests were scheduled but did not complete as expected (Result: ${{ needs.run-e2e-tests.result }})."
SHOULD_POST_COMMENT="true"
JOB_OUTCOME="failure"
fi
echo "comment_body=$COMMENT_BODY" >> $GITHUB_OUTPUT
echo "should_post_comment=$SHOULD_POST_COMMENT" >> $GITHUB_OUTPUT
echo "job_outcome=$JOB_OUTCOME" >> $GITHUB_OUTPUT
- name: Create or Update PR Comment
if: steps.determine_outcome.outputs.should_post_comment == 'true' && needs.eligibility_check.outputs.should_run == 'true'
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.determine_outcome.outputs.comment_body }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Finalize Job Status
run: |
if [[ "${{ steps.determine_outcome.outputs.job_outcome }}" == "failure" ]]; then
exit 1
else
exit 0
fi