-
Notifications
You must be signed in to change notification settings - Fork 600
208 lines (182 loc) · 10.4 KB
/
testcafe_tests.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
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
name: TestCafe tests
concurrency:
group: wf-${{github.event.pull_request.number || github.sha}}-${{github.workflow}}
cancel-in-progress: true
on:
pull_request:
push:
branches: [24_1]
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_TOKEN }}
NX_SKIP_NX_CACHE: ${{ (github.event_name != 'pull_request' || contains( github.event.pull_request.labels.*.name, 'skip-cache')) && 'true' || 'false' }}
BUILD_TEST_INTERNAL_PACKAGE: true
jobs:
build:
name: build
strategy:
fail-fast: false
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'
- name: Restore npm cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
- name: Run npm install
run: npm install --no-audit --no-fund
- name: Build
run: npx nx build devextreme-main
- 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@v3
with:
name: devextreme-artifacts
path: ./packages/devextreme/artifacts.zip
retention-days: 1
testcafe:
name: ${{ matrix.ARGS.name }}
needs: [build]
strategy:
fail-fast: false
matrix:
ARGS: [
{ componentFolder: "accessibility", name: "accessibility (1/5)", indices: "1/5" },
{ componentFolder: "accessibility", name: "accessibility (2/5)", indices: "2/5" },
{ componentFolder: "accessibility", name: "accessibility (3/5)", indices: "3/5" },
{ componentFolder: "accessibility", name: "accessibility (4/5)", indices: "4/5" },
{ componentFolder: "accessibility", name: "accessibility (5/5)", indices: "5/5" },
{ componentFolder: "accessibility", name: "accessibility - material (1/7)", theme: "material.blue.light", indices: "1/7" },
{ componentFolder: "accessibility", name: "accessibility - material (2/7)", theme: "material.blue.light", indices: "2/7" },
{ componentFolder: "accessibility", name: "accessibility - material (3/7)", theme: "material.blue.light", indices: "3/7" },
{ componentFolder: "accessibility", name: "accessibility - material (4/7)", theme: "material.blue.light", indices: "4/7" },
{ componentFolder: "accessibility", name: "accessibility - material (5/7)", theme: "material.blue.light", indices: "5/7" },
{ componentFolder: "accessibility", name: "accessibility - material (6/7)", theme: "material.blue.light", indices: "6/7" },
{ componentFolder: "accessibility", name: "accessibility - material (7/7)", theme: "material.blue.light", indices: "7/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (1/7)", theme: "fluent.blue.light", indices: "1/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (2/7)", theme: "fluent.blue.light", indices: "2/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (3/7)", theme: "fluent.blue.light", indices: "3/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (4/7)", theme: "fluent.blue.light", indices: "4/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (5/7)", theme: "fluent.blue.light", indices: "5/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (6/7)", theme: "fluent.blue.light", indices: "6/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (7/7)", theme: "fluent.blue.light", indices: "7/7" },
{ componentFolder: "common", name: "common" },
{ componentFolder: "common", name: "common - material", theme: 'material.blue.light' },
{ componentFolder: "common", name: "common - fluent", theme: 'fluent.blue.light' },
{ componentFolder: "treeList", name: "treeList", concurrency: 1 },
{ componentFolder: "dataGrid", name: "dataGrid (1/2)", indices: "1/2" },
{ componentFolder: "dataGrid", name: "dataGrid (2/2)", indices: "2/2" },
{ componentFolder: "pivotGrid", name: "pivotGrid", concurrency: 1 },
{ componentFolder: "pivotGrid", name: "pivotGrid - material", theme: 'material.blue.light', concurrency: 1 },
{ componentFolder: "pivotGrid", name: "pivotGrid - fluent", theme: 'fluent.blue.light', concurrency: 1 },
{ componentFolder: "scheduler", name: "scheduler (1/5)", indices: "1/5" },
{ componentFolder: "scheduler", name: "scheduler (2/5)", indices: "2/5" },
{ componentFolder: "scheduler", name: "scheduler (3/5)", indices: "3/5" },
{ componentFolder: "scheduler", name: "scheduler (4/5)", indices: "4/5" },
{ componentFolder: "scheduler", name: "scheduler (5/5)", indices: "5/5" },
{ componentFolder: "scheduler/timezones", name: "scheduler (Europe/Berlin)", timezone: "Europe/Berlin" },
{ componentFolder: "scheduler/timezones", name: "scheduler (America/Los_Angeles)", timezone: "America/Los_Angeles" },
{ componentFolder: "form", name: "form (1/2)", indices: "1/2" },
{ componentFolder: "form", name: "form (2/2)", indices: "2/2" },
{ componentFolder: "form", name: "form - material (1/2)", theme: 'material.blue.light', indices: "1/2" },
{ componentFolder: "form", name: "form - material (2/2)", theme: 'material.blue.light', indices: "2/2" },
{ componentFolder: "form", name: "form - fluent (1/2)", theme: 'fluent.blue.light', indices: "1/2" },
{ componentFolder: "form", name: "form - fluent (2/2)", theme: 'fluent.blue.light', indices: "2/2" },
{ componentFolder: "editors", name: "editors (1/2)", indices: "1/2" },
{ componentFolder: "editors", name: "editors (2/2)", indices: "2/2" },
{ componentFolder: "editors", name: "editors - material (1/2)", theme: 'material.blue.light', indices: "1/2" },
{ componentFolder: "editors", name: "editors - material (2/2)", theme: 'material.blue.light', indices: "2/2" },
{ componentFolder: "editors", name: "editors - fluent (1/2)", theme: 'fluent.blue.light', indices: "1/2" },
{ componentFolder: "editors", name: "editors - fluent (2/2)", theme: 'fluent.blue.light', indices: "2/2" },
{ componentFolder: "htmlEditor", name: "htmlEditor", concurrency: 1 },
{ componentFolder: "htmlEditor", name: "htmlEditor - material", theme: 'material.blue.light', concurrency: 1 },
{ componentFolder: "htmlEditor", name: "htmlEditor - fluent", theme: 'fluent.blue.light', concurrency: 1 },
{ componentFolder: "navigation", name: "navigation" },
{ componentFolder: "navigation", name: "navigation - material", theme: 'material.blue.light' },
{ componentFolder: "navigation", name: "navigation - fluent", theme: 'fluent.blue.light' },
{ componentFolder: "fileManager", name: "fileManager" },
{ componentFolder: "fileManager", name: "fileManager - material", theme: 'material.blue.light' },
{ componentFolder: "fileManager", name: "fileManager - fluent", theme: 'fluent.blue.light' },
{ componentFolder: "filterBuilder", name: "filterBuilder" },
{ componentFolder: "filterBuilder", name: "filterBuilder - material", theme: 'material.blue.light' },
{ componentFolder: "filterBuilder", name: "filterBuilder - fluent", theme: 'fluent.blue.light' },
]
runs-on: devextreme-shr2
timeout-minutes: 90
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: Setup Chrome
uses: ./.github/actions/setup-chrome
with:
chrome-version: '121.0.6167.160'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Restore npm cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
- name: Run npm install
run: npm install --no-audit --no-fund
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: devextreme-artifacts
path: ./packages/devextreme
- name: Unpack artifacts
working-directory: ./packages/devextreme
run: 7z x artifacts.zip -aoa
- name: Run TestCafe tests
working-directory: ./e2e/testcafe-devextreme
run: |
[ "${{ matrix.ARGS.theme }}" != "" ] && THEME="--theme ${{ matrix.ARGS.theme }}"
[ "${{ matrix.ARGS.indices }}" != "" ] && INDICES="--indices ${{ matrix.ARGS.indices }}"
[ "${{ matrix.ARGS.concurrency }}" != "" ] && CONCURRENCY="--concurrency ${{ matrix.ARGS.concurrency }}"
[ "${{ matrix.ARGS.platform }}" != "" ] && PLATFORM="--platform ${{ matrix.ARGS.platform }}"
all_args="--browsers=chrome:devextreme-shr2 --componentFolder ${{ matrix.ARGS.componentFolder }} $CONCURRENCY $INDICES $PLATFORM $THEME"
echo "$all_args"
npx nx test $all_args
- name: Copy compared screenshot artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: compared-screenshots
path: ${{ github.workspace }}/e2e/testcafe-devextreme/artifacts/compared-screenshots/**/*
if-no-files-found: ignore
- name: Copy failed test artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: failed-tests
path: ${{ github.workspace }}/e2e/testcafe-devextreme/artifacts/failedtests/**/*
if-no-files-found: ignore
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