From f66065723a73b87a4bda548b1eec68225e7eab70 Mon Sep 17 00:00:00 2001 From: Cody Olsen <81981+stipsan@users.noreply.github.com> Date: Mon, 10 Feb 2025 13:36:46 +0100 Subject: [PATCH] fix(CI): update playwright cache on CI consistently (#8559) --- .github/workflows/e2e-ct.yml | 5 +++-- .github/workflows/e2e-ui.yml | 10 ++++++---- .github/workflows/e2e.yml | 10 ++++++---- .github/workflows/efps.yml | 5 +++-- .github/workflows/perf.yml | 5 +++-- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e-ct.yml b/.github/workflows/e2e-ct.yml index e9b978a06a9..6ddb1c7ea45 100644 --- a/.github/workflows/e2e-ct.yml +++ b/.github/workflows/e2e-ct.yml @@ -117,16 +117,17 @@ jobs: run: pnpm install - name: Store Playwright's Version + id: playwright-version run: | PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //') echo "Playwright's Version: $PLAYWRIGHT_VERSION" - echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + echo "version=${PLAYWRIGHT_VERSION}" >> "$GITHUB_OUTPUT" - name: Cache Playwright Browsers for Playwright's Version id: cache-playwright-browsers uses: actions/cache@v4 with: path: ~/.cache/ms-playwright - key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} + key: ${{ steps.playwright-version.outputs.version }}-playwright-browsers - name: Install Playwright Browsers # TODO: Fix webkit caching when downloading from cache # for some reason it doesn't work without installing again diff --git a/.github/workflows/e2e-ui.yml b/.github/workflows/e2e-ui.yml index d48dd527f8d..d35a59f5cb8 100644 --- a/.github/workflows/e2e-ui.yml +++ b/.github/workflows/e2e-ui.yml @@ -124,17 +124,18 @@ jobs: - run: pnpm add -w ./artifacts/sanity-ui-*.tgz - name: Store Playwright's Version + id: playwright-version run: | PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //') echo "Playwright's Version: $PLAYWRIGHT_VERSION" - echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + echo "version=${PLAYWRIGHT_VERSION}" >> "$GITHUB_OUTPUT" - name: Cache Playwright Browsers for Playwright's Version id: cache-playwright-browsers uses: actions/cache@v4 with: path: ~/.cache/ms-playwright - key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} + key: ${{ steps.playwright-version.outputs.version }}-playwright-browsers - name: Install Playwright Browsers if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' @@ -235,17 +236,18 @@ jobs: run: pnpm install - name: Store Playwright's Version + id: playwright-version run: | PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //') echo "Playwright's Version: $PLAYWRIGHT_VERSION" - echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + echo "version=${PLAYWRIGHT_VERSION}" >> "$GITHUB_OUTPUT" - name: Cache Playwright Browsers for Playwright's Version id: cache-playwright-browsers uses: actions/cache/restore@v4 with: path: ~/.cache/ms-playwright - key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} + key: ${{ steps.playwright-version.outputs.version }}-playwright-browsers - name: Install Playwright Browsers if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a26e2613138..13379da855e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -54,17 +54,18 @@ jobs: run: pnpm install - name: Store Playwright's Version + id: playwright-version run: | PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //') echo "Playwright's Version: $PLAYWRIGHT_VERSION" - echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + echo "version=${PLAYWRIGHT_VERSION}" >> "$GITHUB_OUTPUT" - name: Cache Playwright Browsers for Playwright's Version id: cache-playwright-browsers uses: actions/cache@v4 with: path: ~/.cache/ms-playwright - key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} + key: ${{ steps.playwright-version.outputs.version }}-playwright-browsers - name: Install Playwright Browsers if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' @@ -158,17 +159,18 @@ jobs: run: pnpm install - name: Store Playwright's Version + id: playwright-version run: | PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //') echo "Playwright's Version: $PLAYWRIGHT_VERSION" - echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + echo "version=${PLAYWRIGHT_VERSION}" >> "$GITHUB_OUTPUT" - name: Cache Playwright Browsers for Playwright's Version id: cache-playwright-browsers uses: actions/cache/restore@v4 with: path: ~/.cache/ms-playwright - key: playwright-browsers-${{ vars.PLAYWRIGHT_VERSION }} + key: ${{ steps.playwright-version.outputs.version }}-playwright-browsers - name: Install Playwright Browsers if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' diff --git a/.github/workflows/efps.yml b/.github/workflows/efps.yml index 5e7e5c1b43e..9ddcb44ff35 100644 --- a/.github/workflows/efps.yml +++ b/.github/workflows/efps.yml @@ -66,17 +66,18 @@ jobs: run: pnpm install - name: Store Playwright's Version + id: playwright-version run: | PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //') echo "Playwright's Version: $PLAYWRIGHT_VERSION" - echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + echo "version=${PLAYWRIGHT_VERSION}" >> "$GITHUB_OUTPUT" - name: Cache Playwright Browsers for Playwright's Version id: cache-playwright-browsers uses: actions/cache@v4 with: path: ~/.cache/ms-playwright - key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} + key: ${{ steps.playwright-version.outputs.version }}-playwright-browsers - name: Install Playwright Browsers if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index c038bbf12e1..894efae8f48 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -44,17 +44,18 @@ jobs: run: pnpm install - name: Store Playwright's Version + id: playwright-version run: | PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //') echo "Playwright's Version: $PLAYWRIGHT_VERSION" - echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + echo "version=${PLAYWRIGHT_VERSION}" >> "$GITHUB_OUTPUT" - name: Cache Playwright Browsers for Playwright's Version id: cache-playwright-browsers uses: actions/cache@v4 with: path: ~/.cache/ms-playwright - key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} + key: ${{ steps.playwright-version.outputs.version }}-playwright-browsers - name: Install Playwright Browsers if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'