mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
Cache the Playwright browser download in CI (#3061)
This commit is contained in:
1 parent
57e213bedc
commit
91fe638d33
3 files changed
+33
-3
No files matched your search
@@ -0,0 +1,31 @@
|
||||
name: Install Playwright Chromium
|
||||
description: Restore the browser download from the cache and install Chromium only when the cache misses
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
# The cache key follows the installed version, so a dependency bump pulls a
|
||||
# fresh browser instead of reusing the one the old Playwright shipped with.
|
||||
- name: Read the Playwright version
|
||||
id: playwright
|
||||
shell: bash
|
||||
run: echo "version=$(node -p "require('playwright/package.json').version")" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Restore the browser download
|
||||
id: cache
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-playwright-${{ steps.playwright.outputs.version }}
|
||||
|
||||
- name: Install Chromium and its system packages
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: pnpm exec playwright install --with-deps chromium
|
||||
|
||||
# The browser comes from the cache, but its system packages live in the
|
||||
# runner image and have to be there on every run.
|
||||
- name: Install the system packages
|
||||
if: steps.cache.outputs.cache-hit == 'true'
|
||||
shell: bash
|
||||
run: pnpm exec playwright install-deps chromium
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
run: pnpm run build
|
||||
|
||||
- name: Install Playwright
|
||||
run: pnpm exec playwright install --with-deps chromium
|
||||
uses: ./.github/actions/playwright
|
||||
|
||||
- name: Check rendered html
|
||||
run: pnpm run check:html preview/dist docs/dist --quiet
|
||||
|
||||
@@ -21,8 +21,7 @@ jobs:
|
||||
uses: ./.github/actions/setup
|
||||
|
||||
- name: Install Playwright Chromium
|
||||
run: pnpm exec playwright install --with-deps chromium
|
||||
working-directory: core
|
||||
uses: ./.github/actions/playwright
|
||||
|
||||
- name: Run JS tests
|
||||
run: pnpm --filter @tabler/core test:js
|
||||
|
||||
Reference in new issue
Block a user