-
-
Notifications
You must be signed in to change notification settings - Fork 321
253 lines (242 loc) · 7.25 KB
/
test.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
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
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '11 11 * * 1'
workflow_dispatch:
jobs:
build:
uses: ./.github/workflows/build.yml
typings:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
id: node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen # 18
cache: 'npm'
- run: npm clean-install
- name: Load cached dist
uses: actions/cache@v3
id: dist
with:
path: dist
key: ${{ needs.build.outputs.cache-key }}
fail-on-cache-miss: true
- name: Check TypeScript type definitions
run: npm run test:types
node:
needs:
- build
continue-on-error: ${{ !startsWith(matrix.node-version, 'lts') }}
strategy:
fail-fast: false
matrix:
node-version:
- lts/fermium # 14
- lts/gallium # 16
- lts/hydrogen # 18
- current
suite:
- tap:node
- test
include:
- node-version: lts/erbium # 12
suite: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
id: node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
check-latest: true
- run: npm install --global npm@8
if: ${{ startsWith(steps.node.outputs.node-version, 'v12') || startsWith(steps.node.outputs.node-version, 'v14') }}
- run: npm clean-install
- name: Load cached dist
uses: actions/cache@v3
id: dist
with:
path: dist
key: ${{ needs.build.outputs.cache-key }}
fail-on-cache-miss: true
- run: |
find test -type f -name '*.mjs' -print0 | xargs -0 sed -i -e "s/await import(/require(/g"
npm install --save-dev ava@4
if: ${{ startsWith(steps.node.outputs.node-version, 'v12') && matrix.suite == 'test' }}
- name: Run Test Suite
run: npm run ${{ matrix.suite }}
deno:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Load cached dist
uses: actions/cache@v3
id: dist
with:
path: dist
key: ${{ needs.build.outputs.cache-key }}
fail-on-cache-miss: true
- name: Test Deno Definitions
run: deno check dist/deno/index.ts
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen # 18
cache: 'npm'
- run: npm clean-install
- name: Test Deno
run: npm run tap:deno
bun:
needs:
- build
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Load cached dist
uses: actions/cache@v3
id: dist
with:
path: dist
key: ${{ needs.build.outputs.cache-key }}
fail-on-cache-miss: true
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen # 18
cache: 'npm'
- run: npm clean-install
- name: Test Bun
run: npm run tap:bun
workerd:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen # 18
cache: 'npm'
- run: npm clean-install
- run: npm install --global workerd
- name: Load cached dist
uses: actions/cache@v3
id: dist
with:
path: dist
key: ${{ needs.build.outputs.cache-key }}
fail-on-cache-miss: true
- name: Run Test Suite
run: npm run tap:workerd
edge-runtime:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen # 18
cache: 'npm'
- run: npm clean-install
- name: Load cached dist
uses: actions/cache@v3
id: dist
with:
path: dist
key: ${{ needs.build.outputs.cache-key }}
fail-on-cache-miss: true
- name: Run Test Suite
run: npm run tap:edge-runtime
browsers:
needs:
- build
runs-on: ${{ matrix.runs-on || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
browser:
- chrome:headless
- firefox:headless
- edge:headless
include:
- runs-on: macos-13
browser: safari
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen # 18
cache: 'npm'
- run: npm clean-install
- run: npm install --global testcafe@2
- name: Add rows to the TCC.db
if: ${{ matrix.runs-on == 'macos-13' }}
run: |
sudo sqlite3 "$HOME/Library/Application Support/com.apple.TCC/TCC.db" "INSERT OR REPLACE INTO access VALUES('kTCCServiceAppleEvents','com.devexpress.testcafe-browser-tools',0,2,3,1,X'fade0c0000000068000000010000000700000007000000080000001443fa4ca5141baeda21aeca1f50894673b440d4690000000800000014f8afcf6e69791b283e55bd0b03e39e422745770e0000000800000014bf4fc1aed64c871a49fc6bc9dd3878ce5d4d17c6',NULL,0,'com.apple.Safari',X'fade0c000000002c00000001000000060000000200000010636f6d2e6170706c652e53616661726900000003',NULL,1687952810);"
sudo sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "INSERT OR REPLACE INTO access VALUES('kTCCServiceScreenCapture','com.devexpress.testcafe-browser-tools',0,2,3,1,X'fade0c0000000068000000010000000700000007000000080000001443fa4ca5141baeda21aeca1f50894673b440d4690000000800000014f8afcf6e69791b283e55bd0b03e39e422745770e0000000800000014bf4fc1aed64c871a49fc6bc9dd3878ce5d4d17c6',NULL,0,'UNUSED',NULL,0,1687952810);"
- name: Load cached dist
uses: actions/cache@v3
id: dist
with:
path: dist
key: ${{ needs.build.outputs.cache-key }}
fail-on-cache-miss: true
- name: Run Test Suite
run: npm run tap:browsers
env:
BROWSER: ${{ matrix.browser }}
electron:
needs:
- build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen # 18
cache: 'npm'
- run: npm clean-install
- name: Load cached dist
uses: actions/cache@v3
id: dist
with:
path: dist
key: ${{ needs.build.outputs.cache-key }}
fail-on-cache-miss: true
- name: Install Electron
run: npm install --global electron
- name: Run Test Suite
run: npm run tap:electron