Skip to content

Commit 0a1f1fc

Browse files
authored
[ci] Cache playwright in run_devtools_e2e_tests (facebook#34320)
I happened to notice that I forgot to cache playwright in run_devtools_e2e_tests, so it would try to install it every time which can randomly take a while to complete (I'm not sure why it's not deterministic, but the dependencies appear to be installed inconsistently across multiple workflows). This PR adds the same cache we use for other steps that use playwright, which should shave off some time from this workflow when the cache is warm. Additionally I omitted the standalone install-deps command as it appears to be redundant and adds a lot of extra time to CI, due to the fact that it installs many unrelated dependencies. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34320). * facebook#34321 * __->__ facebook#34320
1 parent b870042 commit 0a1f1fc

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/compiler_playground.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ jobs:
5757
key: playwright-browsers-v6-${{ runner.arch }}-${{ runner.os }}-${{ steps.playwright_version.outputs.playwright_version }}
5858
- run: npx playwright install --with-deps chromium
5959
if: steps.cache_playwright_browsers.outputs.cache-hit != 'true'
60-
- run: npx playwright install-deps
61-
if: steps.cache_playwright_browsers.outputs.cache-hit == 'true'
6260
- run: CI=true yarn test
6361
- run: ls -R test-results
6462
if: '!cancelled()'

.github/workflows/runtime_build_and_test.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ jobs:
316316
if: steps.node_modules.outputs.cache-hit != 'true'
317317
- run: ./scripts/react-compiler/build-compiler.sh && ./scripts/react-compiler/link-compiler.sh
318318
- run: yarn workspace eslint-plugin-react-hooks test
319-
319+
320320
# ----- BUILD -----
321321
build_and_lint:
322322
name: yarn build and lint
@@ -811,9 +811,18 @@ jobs:
811811
pattern: _build_*
812812
path: build
813813
merge-multiple: true
814-
- run: |
815-
npx playwright install
816-
sudo npx playwright install-deps
814+
- name: Check Playwright version
815+
id: playwright_version
816+
run: echo "playwright_version=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//' | head -1)" >> "$GITHUB_OUTPUT"
817+
- name: Cache Playwright Browsers for version ${{ steps.playwright_version.outputs.playwright_version }}
818+
id: cache_playwright_browsers
819+
uses: actions/cache@v4
820+
with:
821+
path: ~/.cache/ms-playwright
822+
key: playwright-browsers-v6-${{ runner.arch }}-${{ runner.os }}-${{ steps.playwright_version.outputs.playwright_version }}
823+
- name: Playwright install deps
824+
if: steps.cache_playwright_browsers.outputs.cache-hit != 'true'
825+
run: npx playwright install --with-deps chromium
817826
- run: ./scripts/ci/run_devtools_e2e_tests.js
818827
env:
819828
RELEASE_CHANNEL: experimental

0 commit comments

Comments
 (0)