-
Notifications
You must be signed in to change notification settings - Fork 668
264 lines (223 loc) · 8.95 KB
/
testcafe_tests.yml
File metadata and controls
264 lines (223 loc) · 8.95 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
name: TestCafe tests
concurrency:
group: wf-${{github.event.pull_request.number || github.sha}}-${{github.workflow}}
cancel-in-progress: true
on:
pull_request:
paths-ignore:
- 'apps/**/*.md'
push:
branches: [26_1]
workflow_dispatch:
env:
NX_SKIP_NX_CACHE: ${{ contains(github.event.pull_request.labels.*.name, 'skip-cache') && 'true' || 'false' }}
RUN_TESTS: true
jobs:
check-should-run:
name: Check if tests should run
runs-on: devextreme-shr2
outputs:
should-run: ${{ steps.check.outputs.should-run }}
styles-changed: ${{ steps.changes.outputs.styles }}
steps:
- uses: actions/checkout@v4
- name: Check RUN_TESTS flag
id: check
run: echo "should-run=${{ env.RUN_TESTS }}" >> $GITHUB_OUTPUT
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
styles:
- 'packages/devextreme-scss/**'
- 'packages/devextreme/js/**/themes/**'
- 'e2e/testcafe-devextreme/helpers/accessibility/**'
build:
name: Build DevExtreme
needs: check-should-run
if: needs.check-should-run.outputs.should-run == 'true'
runs-on: devextreme-shr2
timeout-minutes: 15
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-cache
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
shell: bash
env:
NODE_OPTIONS: --max-old-space-size=8192
run: |
pnpx nx build devextreme-scss
pnpx nx build devextreme -c testing
- name: Zip artifacts
working-directory: ./packages/devextreme
run: |
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts ../devextreme-scss/scss/bundles
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: devextreme-artifacts
path: ./packages/devextreme/artifacts.zip
retention-days: 1
testcafe:
name: ${{ matrix.ARGS.name }}${{ !matrix.ARGS.theme && ' - fluent' || '' }}
if: needs.check-should-run.outputs.should-run == 'true'
needs: [check-should-run, build]
strategy:
fail-fast: false
matrix:
ARGS: [
{ componentFolder: "accessibility", name: "accessibility" },
{ componentFolder: "accessibility", name: "accessibility - fluent.dark", theme: 'fluent.blue.dark', styleDependent: true },
{ componentFolder: "accessibility", name: "accessibility - material.light", theme: 'material.blue.light', styleDependent: true },
{ componentFolder: "accessibility", name: "accessibility - material.dark", theme: 'material.blue.dark', styleDependent: true },
{ componentFolder: "common", name: "common" },
{ name: "generic", theme: 'generic.light' },
{ name: "material", theme: 'material.blue.light' },
{ name: "material - compact", theme: 'material.blue.light.compact' },
{ componentFolder: "cardView", name: "cardView" },
{ componentFolder: "dataGrid", name: "dataGrid (1/4)", indices: "1/4", cache: true },
{ componentFolder: "dataGrid", name: "dataGrid (2/4)", indices: "2/4", cache: true },
{ componentFolder: "dataGrid", name: "dataGrid (3/4)", indices: "3/4", cache: true },
{ componentFolder: "dataGrid", name: "dataGrid (4/4)", indices: "4/4", cache: true },
{ componentFolder: "editors", name: "editors" },
{ componentFolder: "navigation", name: "navigation" },
{ componentFolder: "scheduler/common", name: "scheduler / common (1/3)", indices: "1/3" },
{ componentFolder: "scheduler/common", name: "scheduler / common (2/3)", indices: "2/3" },
{ componentFolder: "scheduler/common", name: "scheduler / common (3/3)", indices: "3/3" },
{ componentFolder: "scheduler/viewOffset", name: "scheduler / viewOffset (1/2)", indices: "1/2" },
{ componentFolder: "scheduler/viewOffset", name: "scheduler / viewOffset (2/2)", indices: "2/2" },
{ componentFolder: "scheduler/timezones", name: "scheduler / timezones (Europe/Berlin)", timezone: "Europe/Berlin" },
{ componentFolder: "scheduler/timezones", name: "scheduler / timezones (America/Los_Angeles)", timezone: "America/Los_Angeles" },
]
runs-on: devextreme-shr2
timeout-minutes: 45
steps:
- name: Set machine timezone
run: |
sudo ln -sf "/usr/share/zoneinfo/$([ "${{ matrix.ARGS.timezone }}" != "" ] && echo "${{ matrix.ARGS.timezone }}" || echo "GMT")" /etc/localtime
date
- name: Get sources
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: devextreme-artifacts
path: ./packages/devextreme
- name: Unpack artifacts
working-directory: ./packages/devextreme
run: 7z x artifacts.zip -aoa
# - name: Setup Chrome
# uses: ./.github/actions/setup-chrome
# with:
# chrome-version: '146.0.7680.177'
# - name: Use Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '20'
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache/restore@v4
name: Restore pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-cache
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check runner resources
run: |
echo "CPU cores: $(nproc)"
echo "Memory: $(free -h)"
echo "Disk: $(df -h)"
- name: Run TestCafe tests
working-directory: ./e2e/testcafe-devextreme
if: ${{ !matrix.ARGS.styleDependent || needs.check-should-run.outputs.styles-changed == 'true' }}
env:
NODE_OPTIONS: --max-old-space-size=8192
run: |
if [ "${{ matrix.ARGS.theme }}" != "" ]; then
THEME="--theme ${{ matrix.ARGS.theme }}"
else
THEME="--theme fluent.blue.light"
fi
[ "${{ matrix.ARGS.indices }}" != "" ] && INDICES="--indices ${{ matrix.ARGS.indices }}"
[ "${{ matrix.ARGS.concurrency }}" != "" ] && CONCURRENCY="--concurrency ${{ matrix.ARGS.concurrency }}"
[ "${{ matrix.ARGS.platform }}" != "" ] && PLATFORM="--platform ${{ matrix.ARGS.platform }}"
[ "${{ matrix.ARGS.cache }}" == "true" ] && CACHE="--cache true"
all_args="--browsers=chrome:devextreme-shr2 --componentFolder ${{ matrix.ARGS.componentFolder }} $CONCURRENCY $INDICES $PLATFORM $THEME $CACHE"
echo "$all_args"
pnpm run test $all_args
- name: Sanitize job name
if: ${{ always() }}
run: echo "JOB_NAME=$(echo "${{ matrix.ARGS.name }}" | tr '/' '-')" >> $GITHUB_ENV
- name: Copy compared screenshot artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: compared-screenshots-${{ env.JOB_NAME }}
path: ${{ github.workspace }}/e2e/testcafe-devextreme/artifacts/compared-screenshots/**/*
if-no-files-found: ignore
- name: Copy failed test artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: failed-tests-${{ env.JOB_NAME }}
path: ${{ github.workspace }}/e2e/testcafe-devextreme/artifacts/failedtests/**/*
if-no-files-found: ignore
merge-artifacts:
runs-on: devextreme-shr2
needs: testcafe
if: ${{ always() }}
steps:
- name: Merge screenshot artifacts
uses: actions/upload-artifact/merge@v4
continue-on-error: true
with:
name: compared-screenshots
pattern: compared-screenshots-*
delete-merged: true
- name: Merge failed test artifacts
uses: actions/upload-artifact/merge@v4
continue-on-error: true
with:
name: failed-tests
pattern: failed-tests-*
delete-merged: true
notify:
runs-on: devextreme-shr2
name: Send notifications
needs: [build, testcafe]
if: github.event_name != 'pull_request' && contains(needs.*.result, 'failure')
steps:
- uses: actions/checkout@v4
- uses: DevExpress/github-actions/send-teams-notification@v1
with:
hook_url: ${{secrets.TEAMS_ALERT}}
bearer_token: ${{secrets.GITHUB_TOKEN}}
specific_repo: DevExpress/DevExtreme