Add caching for Playwright browsers in workflow
This commit introduces caching for Playwright browsers in the GitHub Actions workflow. It first stores the Playwright version as an environment variable, then attempts to cache the browsers for this specific version. Browsers are only installed if they aren't found in the cache.
This commit is contained in:
14
.github/workflows/workflow.yml
vendored
14
.github/workflows/workflow.yml
vendored
@@ -63,7 +63,21 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Store Playwright's Version
|
||||
run: |
|
||||
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')
|
||||
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
|
||||
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- 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 }}
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
||||
run: pnpm exec ./apps/e2e/node_modules/.bin/playwright install --with-deps
|
||||
|
||||
- name: Supabase CLI
|
||||
|
||||
Reference in New Issue
Block a user