-
Notifications
You must be signed in to change notification settings - Fork 65
283 lines (237 loc) · 8.16 KB
/
pull-request.yml
File metadata and controls
283 lines (237 loc) · 8.16 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
name: Pull Request CI
run-name: ${{ github.actor }} is running Pull Request CI
on:
pull_request_target:
types: [opened, labeled, reopened, synchronize]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
rid: ${{ github.run_id }}-${{ github.run_number }}
PW_SANDBOX_PASSWORD: ${{ secrets.PW_SANDBOX_PASSWORD }}
PW_SENDER_EMAIL_PASSWORD: ${{ secrets.PW_SENDER_EMAIL_PASSWORD }}
PW_SANDBOX: ${{ secrets.PW_SANDBOX }}
PW_ENTRY_POINT1: ${{ secrets.PW_ENTRY_POINT1 }}
PW_ENTRY_POINT2: ${{ secrets.PW_ENTRY_POINT2 }}
PW_ENTRY_POINT3: ${{ secrets.PW_ENTRY_POINT3 }}
PW_ENTRY_POINT4: ${{ secrets.PW_ENTRY_POINT4 }}
PW_ENTRY_POINT5: ${{ secrets.PW_ENTRY_POINT5 }}
PW_ENTRY_POINT6: ${{ secrets.PW_ENTRY_POINT6 }}
PW_ENTRY_POINT7: ${{ secrets.PW_ENTRY_POINT7 }}
PW_ENTRY_POINT8: ${{ secrets.PW_ENTRY_POINT8 }}
PW_ENTRY_POINT9: ${{ secrets.PW_ENTRY_POINT9 }}
PW_ENTRY_POINT10: ${{ secrets.PW_ENTRY_POINT10 }}
PW_ENTRY_POINT11: ${{ secrets.PW_ENTRY_POINT11 }}
PW_ENTRY_POINT12: ${{ secrets.PW_ENTRY_POINT12 }}
PW_SENDER_EMAIL: ${{ secrets.PW_SENDER_EMAIL }}
PW_CHAT_URL: ${{ secrets.PW_CHAT_URL }}
PW_DIAL_NUMBER_LOGIN_USERNAME: ${{ secrets.PW_DIAL_NUMBER_LOGIN_USERNAME }}
PW_DIAL_NUMBER_LOGIN_PASSWORD: ${{ secrets.PW_DIAL_NUMBER_LOGIN_PASSWORD }}
PW_DIAL_NUMBER: ${{ secrets.PW_DIAL_NUMBER }}
PW_DIAL_NUMBER_NAME: ${{ secrets.PW_DIAL_NUMBER_NAME }}
PW_ENTRYPOINT_NAME: ${{ secrets.PW_ENTRYPOINT_NAME }}
PW_MEETING_USERID: ${{ secrets.PW_MEETING_USERID }}
PW_MEETING_PASSWORD: ${{ secrets.PW_MEETING_PASSWORD }}
PW_MEETING_DESTINATION: ${{ secrets.PW_MEETING_DESTINATION}}
jobs:
validate:
name: Validate Pull Request
runs-on: ubuntu-latest
if: contains(toJson(github.event.pull_request.labels), 'validated')
steps:
- name: Validate PR title
run: |
TITLE="${{ github.event.pull_request.title }}"
echo "PR Title is: '$TITLE'"
regex="^(fix|feat|chore|docs)\([^()]+\): .+"
if [[ $TITLE =~ $regex ]]; then
echo "PR title is valid."
else
echo "Error: PR title does NOT follow the required convention."
echo "Expected format: fix|feat|chore(some-text): description..."
exit 1
fi
install:
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- id: validate-dependencies
name: Validate Dependencies
uses: actions/cache@v4
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- id: lock-hash
name: Store Lock Hash
run: echo "hash=$(echo ${{ hashFiles('./yarn.lock') }})" >> $GITHUB_OUTPUT
- name: Install Dependencies
run: yarn
- name: Cache Dependencies
uses: actions/cache@v4
if: steps.validate-dependencies.outputs.cache-hit != 'true'
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
build:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Uncache Dependencies
uses: actions/cache@v4
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Build meetings widget
run: yarn workspace @webex/widgets run build:src
- name: Build cc widgets
run: yarn run build
- name: Cache Distributables
uses: actions/cache@v4
with:
path: '**/dist'
key: dist-${{ env.rid }}
linter:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Uncache Dependencies
uses: actions/cache@v4
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Test linting in meetings widget
run: yarn workspace @webex/widgets run test:eslint
- name: Test linting in cc widgets
run: yarn run test:styles
e2e_test_meetings:
runs-on: ubuntu-latest
continue-on-error: true
needs: [install, build]
if: contains(toJson(github.event.pull_request.labels), 'run_e2e')
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Uncache Dependencies
uses: actions/cache@v4
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Uncache Distributables
uses: actions/cache@v4
with:
path: '**/dist'
key: dist-${{ env.rid }}
- name: Test E2E
run: yarn workspace @webex/widgets run test:e2e
e2e_test_cc_widgets:
timeout-minutes: 50
runs-on: ubuntu-latest
needs: [install, build]
if: contains(toJson(github.event.pull_request.labels), 'run_e2e')
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Uncache Dependencies
uses: actions/cache@v4
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Uncache Distributables
uses: actions/cache@v4
with:
path: '**/dist'
key: dist-${{ env.rid }}
- name: Write Environment Variables
run: |
touch ./.env
echo "PLAYWRIGHT_USERNAME=\"${{ secrets.PLAYWRIGHT_USERNAME }}\"" >> ./.env
echo "PLAYWRIGHT_PASSWORD=\"${{ secrets.PLAYWRIGHT_PASSWORD }}\"" >> ./.env
- name: Run Playwright tests
run: yarn run test:e2e
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: |
**/playwright-report/**
**/test-results/**
retention-days: 10
unit_tests:
runs-on: ubuntu-latest
needs: [install, build]
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Uncache Dependencies
uses: actions/cache@v4
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Uncache Distributables
uses: actions/cache@v4
with:
path: '**/dist'
key: dist-${{ env.rid }}
- name: Test Tooling
run: yarn run test:tooling
- name: Test CC Widgets
run: yarn run test:cc-widgets
- name: Test Meetings Widget
run: yarn run test:meetings-widget