Skip to content

Commit a8c155c

Browse files
authored
[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
1 parent 9954104 commit a8c155c

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/runtime_build_and_test.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,24 @@ jobs:
566566
run: rm -rf build
567567
- run: yarn install --frozen-lockfile
568568
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
569587
- name: Restore archived build
570588
uses: actions/download-artifact@v4
571589
with:
@@ -574,16 +592,6 @@ jobs:
574592
merge-multiple: true
575593
- name: Display structure of build
576594
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
587595
- name: Run tests
588596
working-directory: fixtures/flight
589597
run: yarn test

0 commit comments

Comments
 (0)