Skip to content

Commit d260f25

Browse files
authored
ci: install chromium only and key the browser cache on the catalog (#179)
The tests launch chromium exclusively, so installing all three browser families wasted download time and cache size; a single 'install --with-deps chromium' invocation replaces the two Gradle runs. Also fixes a latent cache bug from the version-catalog migration: the key hashed build.gradle.kts, which no longer contains the Playwright version, so a Playwright bump would have restored stale browsers that PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD then refused to replace. The key now hashes gradle/libs.versions.toml.
1 parent e99fed8 commit d260f25

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ jobs:
3434
# Some dependencies are downloaded to this directory
3535
path: /home/runner/.cache/ms-playwright
3636
# There probably is a smarter way to create this key but this should be ok for now.
37-
key: ms-playwright-cache-${{ runner.os }}-${{ hashFiles('**/build.gradle.kts') }}
37+
key: ms-playwright-chromium-${{ runner.os }}-${{ hashFiles('gradle/libs.versions.toml') }}
3838
- name: Install Playwright Dependencies
3939
if: steps.setup-ms-playwright-cache.outputs.cache-hit != 'true'
40-
run: |
41-
./gradlew playwright --args="install-deps" --no-daemon
42-
./gradlew playwright --args="install" --no-daemon
40+
# Chromium only — the only browser the tests use; one Gradle invocation.
41+
run: ./gradlew playwright --args="install --with-deps chromium" --no-daemon
4342
- name: build
4443
env:
4544
# Browsers will have been installed earlier

.github/workflows/upstream-canary.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ jobs:
6969
key: ms-playwright-cache-${{ runner.os }}-${{ hashFiles('reference-app/build.gradle.kts') }}
7070
- name: Install Playwright Dependencies
7171
if: steps.setup-ms-playwright-cache.outputs.cache-hit != 'true'
72-
run: |
73-
./gradlew playwright --args="install-deps" --no-daemon
74-
./gradlew playwright --args="install" --no-daemon
72+
# Chromium only — the only browser the tests use; one Gradle invocation.
73+
run: ./gradlew playwright --args="install --with-deps chromium" --no-daemon
7574
- name: Build against upstream main
7675
if: matrix.upstream == 'main'
7776
env:

0 commit comments

Comments
 (0)