2023-04-04 03:29:52 -07:00
|
|
|
name: PR E2E
|
2023-01-17 04:44:19 -08:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request_review:
|
|
|
|
types: [submitted]
|
2024-08-22 02:41:53 -07:00
|
|
|
branches:
|
2023-01-17 04:44:19 -08:00
|
|
|
- 'master'
|
2024-08-22 02:41:53 -07:00
|
|
|
- 'release/*'
|
2023-01-17 04:44:19 -08:00
|
|
|
|
2023-11-10 06:26:42 -08:00
|
|
|
concurrency:
|
|
|
|
group: e2e-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-01-17 04:44:19 -08:00
|
|
|
jobs:
|
2023-03-02 07:50:21 -08:00
|
|
|
run-e2e-tests:
|
2023-06-02 06:23:28 -07:00
|
|
|
name: E2E [Electron/Node 18]
|
2023-03-02 07:50:21 -08:00
|
|
|
uses: ./.github/workflows/e2e-reusable.yml
|
2023-04-13 09:16:24 -07:00
|
|
|
if: ${{ github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'community') }}
|
2023-03-02 07:50:21 -08:00
|
|
|
with:
|
2023-10-13 01:44:26 -07:00
|
|
|
pr_number: ${{ github.event.pull_request.number }}
|
2023-03-02 07:50:21 -08:00
|
|
|
user: ${{ github.event.pull_request.user.login || 'PR User' }}
|
|
|
|
secrets:
|
|
|
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
2023-04-06 01:15:26 -07:00
|
|
|
|
|
|
|
post-e2e-tests:
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-02 06:23:28 -07:00
|
|
|
name: E2E [Electron/Node 18] - Checks
|
2023-04-06 01:15:26 -07:00
|
|
|
needs: [run-e2e-tests]
|
2023-04-12 05:13:42 -07:00
|
|
|
if: always()
|
2023-04-06 01:15:26 -07:00
|
|
|
steps:
|
|
|
|
- name: E2E success comment
|
2023-04-21 04:31:39 -07:00
|
|
|
if: ${{!contains(github.event.pull_request.labels.*.name, 'community') && needs.run-e2e-tests.outputs.tests_passed == 'true' }}
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: peter-evans/create-or-update-comment@v4.0.0
|
2023-04-06 01:15:26 -07:00
|
|
|
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
|
2023-04-12 05:13:42 -07:00
|
|
|
if: needs.run-e2e-tests.result == 'failure'
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: peter-evans/create-or-update-comment@v4.0.0
|
2023-04-06 01:15:26 -07:00
|
|
|
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 }}
|
2023-04-12 05:13:42 -07:00
|
|
|
|
2023-04-13 09:16:24 -07:00
|
|
|
- name: Success job if community PR
|
|
|
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'community') }}
|
|
|
|
run: exit 0
|
|
|
|
|
2023-04-12 05:13:42 -07:00
|
|
|
- name: Fail job if run-e2e-tests failed
|
2023-06-16 03:17:04 -07:00
|
|
|
if: ${{ (github.event.review.state != 'approved' && github.event.review.state != 'commented') || needs.run-e2e-tests.result == 'failure' }}
|
2023-04-12 05:13:42 -07:00
|
|
|
run: exit 1
|