[ci] Cache playwright browsers (#32678)
No reason to download them from scratch every time. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32678). * #32680 * #32679 * __->__ #32678
lauren committed
Mar 19, 2025 at 17:22 UTC
a8c155cab91d4a33d06a904bfc23aadacfba8383
1 file changed
+18
-10
.github/workflows/runtime_build_and_test.yml
+18
-10
@@ -566,6 +566,24 @@ jobs:
566
run: rm -rf build
567
- run: yarn install --frozen-lockfile
568
if: steps.node_modules.outputs.cache-hit != 'true'
569
+ - run: yarn --cwd fixtures/flight install --frozen-lockfile
570
+ if: steps.node_modules.outputs.cache-hit != 'true'
571
+ - name: Store Playwright version
572
+ id: playwright_version
573
+ run: |
574
+ PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')
575
+ echo "Playwright's Version: $PLAYWRIGHT_VERSION"
576
+ echo "playwright_version=$PLAYWRIGHT_VERSION" >> "$GITHUB_OUTPUT"
577
+ - name: Cache Playwright Browsers for Playwright's Version
578
+ id: cache_playwright_browsers
579
+ uses: actions/cache@v4
580
+ with:
581
+ path: ~/.cache/ms-playwright
582
+ key: playwright-browsers-v6-${{ runner.arch }}-${{ runner.os }}-${{ steps.playwright_version.outputs.playwright_version }}
583
+ - name: Playwright install deps
584
+ if: steps.cache_playwright_browsers.outputs.cache-hit != 'true'
585
+ working-directory: fixtures/flight
586
+ run: npx playwright install --with-deps chromium
587
- name: Restore archived build
588
uses: actions/download-artifact@v4
589
with:
@@ -574,16 +592,6 @@ jobs:
592
merge-multiple: true
593
- name: Display structure of build
594
run: ls -R build
577
- - name: Install fixture dependencies
578
- working-directory: fixtures/flight
579
- run: |
580
- yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
581
- if [ $? -ne 0 ]; then
582
- yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
583
- fi
584
- - name: Playwright install deps
585
- working-directory: fixtures/flight
586
- run: npx playwright install --with-deps chromium
595
- name: Run tests
596
working-directory: fixtures/flight
597
run: yarn test