From 5f9550ff4aea9070e584277f042b438cc967412f Mon Sep 17 00:00:00 2001 From: ardetrick <1452182+ardetrick@users.noreply.github.com> Date: Sun, 5 Jul 2026 15:44:37 -0500 Subject: [PATCH 1/2] ci: key the browser cache on the Playwright version alone Hashing the whole version catalog meant any dependency bump paid the 60s cold browser install; the key now uses the Playwright version itself, so the cache only invalidates when the browsers actually change. Also answers the old inline comment wondering whether a smarter key exists. --- .github/workflows/gradle.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index f38d838..a73a929 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -28,14 +28,18 @@ jobs: distribution: 'temurin' - name: Set up Gradle uses: gradle/actions/setup-gradle@v6 + # Key the browser cache on the Playwright version alone so unrelated dependency + # bumps in the catalog do not trigger a browser reinstall. + - name: Resolve Playwright version + id: playwright-version + run: echo "version=$(grep -m1 '^playwright = ' gradle/libs.versions.toml | cut -d'"' -f2)" >> "$GITHUB_OUTPUT" - name: Setup ms-playwright cache id: setup-ms-playwright-cache uses: actions/cache@v6 with: # Some dependencies are downloaded to this directory path: /home/runner/.cache/ms-playwright - # There probably is a smarter way to create this key but this should be ok for now. - key: ms-playwright-chromium-${{ runner.os }}-${{ hashFiles('gradle/libs.versions.toml') }} + key: ms-playwright-chromium-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} - name: Install Playwright Dependencies if: steps.setup-ms-playwright-cache.outputs.cache-hit != 'true' # Chromium only — the only browser the tests use; one Gradle invocation. From 67306045793b86be1dd2aa20171f42dc692c03b7 Mon Sep 17 00:00:00 2001 From: ardetrick <1452182+ardetrick@users.noreply.github.com> Date: Sun, 5 Jul 2026 15:45:51 -0500 Subject: [PATCH 2/2] ci: fix the canary's browser cache key too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The canary still carried the original key on reference-app/ build.gradle.kts — the earlier chromium-only change silently missed it because its text differed — so it kept the stale-cache bug: a Playwright bump would restore old browsers that PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD then refuses to replace. Now keyed on the Playwright version like the CI workflow. --- .github/workflows/upstream-canary.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-canary.yml b/.github/workflows/upstream-canary.yml index 9dfe0fc..ead7275 100644 --- a/.github/workflows/upstream-canary.yml +++ b/.github/workflows/upstream-canary.yml @@ -62,12 +62,17 @@ jobs: distribution: 'temurin' - name: Set up Gradle uses: gradle/actions/setup-gradle@v6 + # Key the browser cache on the Playwright version alone so unrelated dependency + # bumps do not trigger a browser reinstall. + - name: Resolve Playwright version + id: playwright-version + run: echo "version=$(grep -m1 '^playwright = ' gradle/libs.versions.toml | cut -d'"' -f2)" >> "$GITHUB_OUTPUT" - name: Setup ms-playwright cache id: setup-ms-playwright-cache uses: actions/cache@v6 with: path: /home/runner/.cache/ms-playwright - key: ms-playwright-cache-${{ runner.os }}-${{ hashFiles('reference-app/build.gradle.kts') }} + key: ms-playwright-chromium-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} - name: Install Playwright Dependencies if: steps.setup-ms-playwright-cache.outputs.cache-hit != 'true' # Chromium only — the only browser the tests use; one Gradle invocation.