This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
303 lines (243 loc) Β· 8.09 KB
/
tests-runner.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
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
name: Bundling Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
web5ApiVersion:
description: "Select the desired @web5/api version"
required: false
dwnVersion:
description: "Select the desired @tbd54566975/dwn-sdk-js version"
required: false
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
test-node-web5:
strategy:
fail-fast: false
matrix:
node-version: [20, 18]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: β¬οΈ Checkout source
uses: actions/checkout@v4
- name: π¦ Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: βοΈ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- name: π₯ Install dependencies
run: pnpm install
- name: π Update Web5 Version
if: ${{ github.event.inputs.web5ApiVersion }}
run: |
pnpm i -w @web5/api@${{ github.event.inputs.web5ApiVersion }}
- name: π§ͺ Run Web5 tests
run: pnpm test:web5
test-node-dwn:
strategy:
fail-fast: false
matrix:
node-version: [20, 18]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: β¬οΈ Checkout source
uses: actions/checkout@v4
- name: π¦ Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: βοΈ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- name: π₯ Install dependencies
run: pnpm install
- name: π Update dwn-sdk-js Version
if: ${{ github.event.inputs.dwnVersion }}
run: |
pnpm i -w @tbd54566975/dwn-sdk-js@${{ github.event.inputs.dwnVersion }}
- name: π§ͺ Run DWN tests
run: pnpm test:dwn
# reference: https://github.com/remarkablemark/react-native-cli-quickstart/blob/master/.github/workflows/e2e-ios.yml
test-rn-ios:
timeout-minutes: 60
runs-on: macos-14
defaults:
run:
working-directory: ./tests/reactnative
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 18
cache-dependency-path: ./tests/reactnative/yarn.lock
- name: Install Yarn dependencies
run: yarn --frozen-lockfile --prefer-offline
- name: π Update Web5 Version
if: ${{ github.event.inputs.web5ApiVersion }}
run: |
yarn add @web5/api@${{ github.event.inputs.web5ApiVersion }}
cat package.json
- name: π Update dwn-sdk-js Version
if: ${{ github.event.inputs.dwnVersion }}
run: |
yarn add @tbd54566975/dwn-sdk-js@${{ github.event.inputs.dwnVersion }}
cat package.json
- name: Install macOS dependencies
run: |
brew tap wix/brew
brew install applesimutils
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
# useful to debug supported devices in action runner
# - name: List available simulator devices
# run: applesimutils --list
- name: Restore CocoaPods
id: restore-cocoapods
uses: actions/cache/restore@v3
with:
path: tests/reactnative/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('tests/reactnative/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install CocoaPods
run: NO_FLIPPER=1 cd ios && pod install ; cd ..
- name: Save CocoaPods
uses: actions/cache/save@v3
if: success()
id: save-cocoapods
with:
path: tests/reactnative/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('tests/reactnative/ios/Podfile.lock') }}
- name: Restore Detox build
id: restore-detox-build
uses: actions/cache/restore@v3
with:
path: tests/reactnative/ios/build
key: ${{ runner.os }}-detox-${{ hashFiles('tests/reactnative/ios/Podfile.lock') }}
- name: Detox build
if: steps.restore-detox-build.outputs.cache-hit != 'true'
run: yarn detox build --configuration ios.sim.debug
- name: Save Detox Build
uses: actions/cache/save@v3
if: success()
id: save-detox-build
with:
path: tests/reactnative/ios/build
key: ${{ runner.os }}-detox-${{ hashFiles('tests/reactnative/ios/Podfile.lock') }}
- name: Run tests
run: yarn test
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-rn-ios-detox-artifacts
path: tests/reactnative/artifacts
test-browsers:
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
browser:
[
"desktop-safari",
"desktop-chrome",
"desktop-firefox",
"desktop-edge",
"mobile-safari",
"mobile-chrome",
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: π Update Web5 Version
if: ${{ github.event.inputs.web5ApiVersion }}
run: |
pnpm i -w @web5/api@${{ github.event.inputs.web5ApiVersion }}
cat package.json
- name: π Update dwn-sdk-js Version
if: ${{ github.event.inputs.dwnVersion }}
run: |
pnpm i -w @tbd54566975/dwn-sdk-js@${{ github.event.inputs.dwnVersion }}
cat package.json
- name: Install Playwright Browsers
run: pnpm playwright install --with-deps
- name: Run browser tests
run: TEST_PARAMS="--project=${{ matrix.browser }} --trace=on" pnpm test:browser
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
test-electron:
if: false # We are skipping `test-electron` due to the lack of support for `AES-KW` key wrapping. Will revisit.
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./tests/electron-vite
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache: yarn
node-version: 18
cache-dependency-path: ./tests/electron-vite/yarn.lock
- name: Install Yarn dependencies
run: yarn --frozen-lockfile --prefer-offline
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- name: π Update Web5 Version
if: ${{ github.event.inputs.web5ApiVersion }}
run: |
yarn add @web5/api@${{ github.event.inputs.web5ApiVersion }}
cat package.json
- name: π Update dwn-sdk-js Version
if: ${{ github.event.inputs.dwnVersion }}
run: |
yarn add @tbd54566975/dwn-sdk-js@${{ github.event.inputs.dwnVersion }}
cat package.json
- name: Build electron app
run: yarn build
- name: Run electron tests
run: yarn test --trace=on
if: matrix.os != 'ubuntu-latest'
- name: Run electron tests (xvfb)
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test --trace=on
if: matrix.os == 'ubuntu-latest'
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: tests/electron-vite/playwright-report/
retention-days: 30