-
Notifications
You must be signed in to change notification settings - Fork 852
129 lines (122 loc) · 3.79 KB
/
e2e-functional.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Electron Playwright Tests
on:
push:
branches:
- master
pull_request:
types:
- labeled
workflow_dispatch:
inputs:
version_name:
type: string
description: "Desktop Version name eg: 5.6"
required: true
job_name:
type: choice
description: "Job name"
required: true
default: "All"
options:
- "e2e-linux"
- "e2e-macos"
- "e2e-windows"
- "All"
jobs:
e2e-linux:
if: ${{
(
(inputs.job_name == 'e2e-linux' || inputs.job_name == 'All')
&&
github.event_name == 'workflow_dispatch'
) ||
(
github.event_name == 'push'
) ||
(
github.event_name == 'pull_request' &&
github.event.pull_request.labels &&
contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests')
)
}}
uses: ./.github/workflows/e2e-functional-template.yml
secrets: inherit
with:
runs-on: ubuntu-22.04
DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }}
e2e-macos:
if: ${{
(
(inputs.job_name == 'e2e-macos' || inputs.job_name == 'All')
&&
github.event_name == 'workflow_dispatch'
) ||
(
github.event_name == 'push'
) ||
(
github.event_name == 'pull_request' &&
github.event.pull_request.labels &&
contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests')
)
}}
uses: ./.github/workflows/e2e-functional-template.yml
secrets: inherit
with:
runs-on: macos-13
DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }}
e2e-windows:
if: ${{
(
(inputs.job_name == 'e2e-windows' || inputs.job_name == 'All')
&&
github.event_name == 'workflow_dispatch'
) ||
(
github.event_name == 'push'
) ||
(
github.event_name == 'pull_request' &&
github.event.pull_request.labels &&
contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests')
)
}}
uses: ./.github/workflows/e2e-functional-template.yml
secrets: inherit
with:
runs-on: windows-2022
DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }}
e2e-remove-label:
if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests') }}
needs: [e2e-linux, e2e-macos, e2e-windows]
runs-on: ubuntu-22.04
steps:
- name: e2e/unify-comments-in-single-comment
run: |
echo "PR_COMMENT<<EOF" >> "${GITHUB_ENV}"
echo "Here are the test results below:" >> "${GITHUB_ENV}"
echo "${{ needs.e2e-linux.outputs.COMMENT_BODY }}" >> "${GITHUB_ENV}"
echo "${{ needs.e2e-macos.outputs.COMMENT_BODY }}" >> "${GITHUB_ENV}"
echo "${{ needs.e2e-windows.outputs.COMMENT_BODY }}" >> "${GITHUB_ENV}"
echo "EOF" >> "${GITHUB_ENV}"
- name: e2e/send-comment-results-in-pr
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.PR_COMMENT,
});
- name: e2e/remove-label-from-pr
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
continue-on-error: true # Label might have been removed manually
with:
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Run Desktop E2E Tests',
});