Skip to content

Commit

Permalink
fix(CI): update playwright cache on CI consistently (#8559)
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan authored Feb 10, 2025
1 parent 85c0379 commit f660657
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/e2e-ct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/e2e-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/efps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit f660657

Please sign in to comment.