-
Notifications
You must be signed in to change notification settings - Fork 179
576 lines (475 loc) · 17.8 KB
/
Copy pathpr.yml
File metadata and controls
576 lines (475 loc) · 17.8 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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
name: PR
on: pull_request
permissions:
contents: read
env:
VisualStudioVersion: '18.0'
WindowsTargetPlatformVersion: '10.0.26100.0'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
js:
name: JS PR
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
node-version: 22
- name: Install dependencies
run: yarn
- name: Build CI
run: yarn lage buildci
bundle-size:
name: Bundle Size PR
runs-on: windows-latest
timeout-minutes: 30
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
node-version: 22
- name: Install dependencies
run: yarn
- name: Read base branch bundle baseline
shell: powershell
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
$baseline = "$env:RUNNER_TEMP\bundle-size-baseline.json"
$baselinePath = 'apps/bundle-size/baseline.json'
$baselineExists = git ls-tree --name-only $env:BASE_SHA -- $baselinePath
if ($baselineExists) {
git show "$env:BASE_SHA`:apps/bundle-size/baseline.json" | Out-File -FilePath $baseline -Encoding utf8
} else {
Copy-Item $baselinePath $baseline
}
- name: Measure bundle sizes
run: yarn bundle-size --baseline "$env:RUNNER_TEMP\bundle-size-baseline.json"
- name: Publish bundle size summary
run: Get-Content apps\bundle-size\dist\bundle-size\report.md -Raw | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
- name: Publish bundle size PR comment
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]' }}
env:
EXPECTED_HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPORT_PATH: apps/bundle-size/dist/bundle-size/report.md
SOURCE_RUN_ID: ${{ github.run_id }}
run: node apps/bundle-size/scripts/post-pr-comment.mjs
- name: Add pull request metadata
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: Set-Content apps\bundle-size\dist\bundle-size\pull-request-number.txt $env:PR_NUMBER -NoNewline
- name: Upload bundle analysis
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bundle-size-analysis
path: apps/bundle-size/dist/bundle-size
if-no-files-found: warn
retention-days: 14
android:
name: Android PR
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
platform: android
node-version: 22
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Bundle Android
run: yarn bundle:android
working-directory: apps/fluent-tester
# Android E2E tests are currently disabled
# - name: Build Android APK
# ...
# - name: Run E2E Android tests
# ...
macos:
name: macOS PR
runs-on: macos-26
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
platform: macos
node-version: 22
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Bundle macOS
run: |
set -eox pipefail
yarn bundle:macos
working-directory: apps/fluent-tester
- name: Pod install
run: |
set -eox pipefail
pod install --verbose
working-directory: apps/fluent-tester/macos
- name: Build macOS app
run: ./.github/scripts/xcodebuild.mts apps/fluent-tester/macos/FluentTester.xcworkspace macosx ReactTestApp build
env:
CCACHE_DISABLE: 1
# Disable macOS E2E test to unblock 0.81 checkin
- name: Prepare E2E macOS tests
run: yarn e2eprep:macos
working-directory: apps/E2E
- name: Run E2E macOS tests
run: yarn e2etest:macos
working-directory: apps/E2E
- name: Upload E2E macOS artifacts
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: E2E_macos_Dump
path: |
apps/E2E/reports
apps/E2E/errorShots
macos-storybook:
name: macOS Storybook PR
runs-on: macos-26
timeout-minutes: 40
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
platform: macos
node-version: 22
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Bundle macOS
run: |
set -eox pipefail
yarn storybook bundle --macos
working-directory: apps/storybook
- name: Pod install
run: yarn storybook prep --macos
working-directory: apps/storybook
- name: Run through storybook smoke tests
run: yarn storybook smoke --macos --mode stories-and-tests
working-directory: apps/storybook
env:
CCACHE_DISABLE: 1
ios:
name: iOS PR
runs-on: macos-26
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
platform: ios
node-version: 22
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Bundle iOS
run: |
set -eox pipefail
yarn bundle:ios
working-directory: apps/fluent-tester
- name: Pod install
run: |
set -eox pipefail
pod install --verbose
working-directory: apps/fluent-tester/ios
- name: Build iOS app
run: ./.github/scripts/xcodebuild.mts apps/fluent-tester/ios/FluentTester.xcworkspace iphonesimulator ReactTestApp build
env:
CCACHE_DISABLE: 1
# iOS E2E tests are currently disabled
# - name: Prepare E2E iOS tests
# run: yarn e2eprep:ios
# working-directory: apps/E2E
# - name: Run E2E iOS tests
# run: yarn e2etest:ios
# working-directory: apps/E2E
windows:
name: Windows PR
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 5
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
platform: windows
node-version: 22
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Bundle Windows
run: yarn bundle:windows
working-directory: apps/fluent-tester
- name: Install WinAppDriver 1.1
run: |
Invoke-WebRequest https://github.com/microsoft/WinAppDriver/releases/download/v1.1/WindowsApplicationDriver.msi -OutFile $env:RUNNER_TEMP\WinAppDriver.msi
Start-Process msiexec -ArgumentList "/quiet","/x","{087BBF93-D9E3-4D27-BDBE-9C702E0066FC}" -Verb runAs -Wait
Start-Process msiexec -ArgumentList "/quiet","/i","$env:RUNNER_TEMP\WinAppDriver.msi" -Verb runAs -Wait
shell: powershell
- name: Generate RNW app
run: yarn install-windows-test-app --use-nuget
working-directory: apps/fluent-tester
- name: Prepare E2E Windows tests
run: yarn e2eprep:windows
working-directory: apps/E2E
- name: Start packager
run: cmd /c "start /B cmd /c yarn start ^> packager.log 2^>^&1"
working-directory: apps/fluent-tester
# First build of RNW may fail with Cannot open include file: 'CppWinRTIncludes.h' error
# So we run the build command twice
- name: Build RNW app
run: yarn windows --arch x64 --logging --no-packager --no-launch --msbuildprops WindowsTargetPlatformVersion=10.0.26100.0; yarn windows --arch x64 --logging --no-packager --no-launch --msbuildprops WindowsTargetPlatformVersion=10.0.26100.0 || yarn windows --arch x64 --logging --no-packager --no-launch --singleproc --msbuildprops WindowsTargetPlatformVersion=10.0.26100.0
working-directory: apps/fluent-tester
- name: Run E2E RNW tests
shell: powershell
run: |
.\launchE2EWindows.ps1 -enableDumpFiles
working-directory: apps/E2E
- name: Upload E2E Windows artifacts
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: E2E_RNW_Dump
path: |
apps/E2E/reports
apps/E2E/errorShots
apps/fluent-tester/packager.log
windows-storybook:
name: Windows Storybook PR
runs-on: windows-latest
timeout-minutes: 40
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 5
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
platform: windows
node-version: 22
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Prep Windows Storybook
run: yarn storybook prep --windows
working-directory: apps/storybook
- name: Install Windows App Runtime 1.8
shell: pwsh
run: |
$installer = Join-Path $env:RUNNER_TEMP 'WindowsAppRuntimeInstall-x64.exe'
Invoke-WebRequest 'https://aka.ms/windowsappsdk/1.8/1.8.260804001/windowsappruntimeinstall-x64.exe' -OutFile $installer
& $installer --quiet
if ($LASTEXITCODE -ne 0) {
throw "Windows App Runtime installer exited with code $LASTEXITCODE."
}
$runtime = Get-AppxPackage -Name 'Microsoft.WindowsAppRuntime.1.8'
if (-not $runtime) {
throw 'Microsoft.WindowsAppRuntime.1.8 was not registered for the runner user.'
}
- name: Smoke test Windows Storybook
run: yarn storybook smoke --windows --mode stories-and-tests
working-directory: apps/storybook
- name: Upload Windows Storybook artifacts
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Storybook_windows_Dump
path: apps/storybook/artifacts/windows
win32:
name: Win32 PR
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
platform: windows
node-version: 22
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Bundle Win32
run: yarn bundle
working-directory: apps/win32
- name: Install WinAppDriver 1.1
run: |
Invoke-WebRequest https://github.com/microsoft/WinAppDriver/releases/download/v1.1/WindowsApplicationDriver.msi -OutFile $env:RUNNER_TEMP\WinAppDriver.msi
Start-Process msiexec -ArgumentList "/quiet","/x","{087BBF93-D9E3-4D27-BDBE-9C702E0066FC}" -Verb runAs -Wait
Start-Process msiexec -ArgumentList "/quiet","/i","$env:RUNNER_TEMP\WinAppDriver.msi" -Verb runAs -Wait
shell: powershell
- name: Prepare E2E Win32 tests
run: yarn e2eprep:win32
working-directory: apps/E2E
- name: Run E2E Win32 tests
run: yarn e2etest:win32
working-directory: apps/E2E
- name: Upload E2E Win32 artifacts
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: E2E_win32_Dump
path: |
apps/E2E/reports
apps/E2E/errorShots
win32-storybook:
name: Win32 Storybook PR
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
platform: windows
node-version: 22
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Smoke test Win32 Storybook
run: yarn storybook smoke --win32 --mode stories-and-tests
working-directory: apps/storybook
- name: Upload Win32 Storybook artifacts
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Storybook_win32_Dump
path: apps/storybook/artifacts/win32
check-changesets:
name: Check for Changesets
runs-on: ubuntu-latest
# Skip this check for the version bump PR created by changesets
if: ${{ github.head_ref != 'changeset-release/main' }}
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
filter: blob:none
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: '22'
cache: 'yarn'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Validate changesets
run: yarn change:check
publish-dry-run-pack:
name: NPM Publish Dry Run — Pack
runs-on: ubuntu-latest
timeout-minutes: 60
outputs:
has-tarballs: ${{ steps.check.outputs.has-tarballs }}
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
node-version: 22
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Pack packages
run: yarn lage pack --verbose --grouped
- name: List packed tarballs
id: check
run: |
ls -laR _packed/
if ls _packed/*/*.tgz > /dev/null 2>&1; then
echo "has-tarballs=true" >> $GITHUB_OUTPUT
else
echo "has-tarballs=false" >> $GITHUB_OUTPUT
fi
- name: Upload packed tarballs
if: steps.check.outputs.has-tarballs == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: packed-tarballs-dry-run
path: _packed/
test-links:
name: Test repo links
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up toolchain
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@1230975885a9e5d3a2ad58b1483f80b09cec04f2 # 5.2.3
with:
node-version: 22
- name: Install dependencies
run: yarn
- name: Test markdown links
run: yarn lage test-links --verbose --grouped
pr:
name: PR
if: always()
runs-on: ubuntu-latest
needs:
- js
- android
- macos
- ios
- windows
- win32
- check-changesets
- publish-dry-run-pack
- test-links
steps:
- name: Check for failures or cancellations
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: |
echo "One or more required jobs failed or were cancelled."
exit 1
- name: All required jobs passed
run: echo "All required jobs completed successfully."