[ci] Add run_fixtures_flight_tests to gh actions
ghstack-source-id: 76761e302fc8e6c3c3243582250c168460b54739 Pull Request resolved: https://github.com/facebook/react/pull/30356
Lauren Tan committed
Jul 16, 2024 at 14:35 UTC
9a8f3de0a82124c594c9799289702db58366844a
1 file changed
+58
.github/workflows/runtime_build_and_test.yml
+58
@@ -347,6 +347,64 @@ jobs:
347
run: ls -R build
348
- run: yarn check-release-dependencies
349
350
+ # ----- FLIGHT -----
351
+ run_fixtures_flight_tests:
352
+ name: Run fixtures Flight tests
353
+ needs: build_and_lint
354
+ runs-on: ubuntu-latest
355
+ steps:
356
+ - uses: actions/checkout@v4
357
+ - uses: actions/setup-node@v4
358
+ with:
359
+ node-version: 18.20.1
360
+ cache: yarn
361
+ cache-dependency-path: yarn.lock
362
+ # Fixture copies some built packages from the workroot after install.
363
+ # That means dependencies of the built packages are not installed.
364
+ # We need to install dependencies of the workroot to fulfill all dependency constraints
365
+ - name: Restore cached node_modules
366
+ uses: actions/cache@v4
367
+ id: node_modules
368
+ with:
369
+ path: "**/node_modules"
370
+ key: v2-yarn_cache_fixtures_flight-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
371
+ - run: yarn install --frozen-lockfile
372
+ - name: Restore archived build
373
+ uses: actions/download-artifact@v4
374
+ with:
375
+ path: build
376
+ merge-multiple: true
377
+ - name: Display structure of build
378
+ run: ls -R build
379
+ - name: Install fixture dependencies
380
+ working-directory: fixtures/flight
381
+ run: |
382
+ yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
383
+ if [ $? -ne 0 ]; then
384
+ yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
385
+ fi
386
+ - name: Playwright install deps
387
+ working-directory: fixtures/flight
388
+ run: |
389
+ npx playwright install
390
+ sudo npx playwright install-deps
391
+ - name: Run tests
392
+ working-directory: fixtures/flight
393
+ run: yarn test
394
+ env:
395
+ # Otherwise the webserver is a blackbox
396
+ DEBUG: pw:webserver
397
+ - name: Archive Flight fixture artifacts
398
+ uses: actions/upload-artifact@v4
399
+ with:
400
+ name: flight-playwright-report
401
+ path: fixtures/flight/playwright-report
402
+ - name: Archive Flight fixture artifacts
403
+ uses: actions/upload-artifact@v4
404
+ with:
405
+ name: flight-test-results
406
+ path: fixtures/flight/test-results
407
+
408
# ----- DEVTOOLS -----
409
build_devtools_and_process_artifacts:
410
name: Build DevTools and process artifacts