Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/actions/playwright-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Install Playwright browsers
description: Cache and install Playwright Chromium browser and system dependencies

runs:
using: composite
steps:
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps chromium
shell: bash
- name: Install Playwright system dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: yarn playwright install-deps chromium
shell: bash
25 changes: 2 additions & 23 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
cache-node-modules: true
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1

lint:
name: Lint
Expand All @@ -33,8 +31,6 @@ jobs:
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: yarn lint
- name: Require clean working directory
shell: bash
Expand All @@ -57,8 +53,6 @@ jobs:
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: yarn changelog:validate
- name: Require clean working directory
shell: bash
Expand All @@ -81,8 +75,6 @@ jobs:
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: yarn build
- name: Require clean working directory
shell: bash
Expand All @@ -105,8 +97,7 @@ jobs:
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
env:
PLAYWRIGHT_ONLY_SHELL: 1
- uses: ./.github/actions/playwright-install
- run: yarn build
- run: "yarn test --coverage=${{ matrix.node-version == '24.x' && 'true' || 'false' }}"
- name: Upload coverage artifact
Expand Down Expand Up @@ -137,8 +128,6 @@ jobs:
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: yarn build
- run: yarn test:integration
- name: Require clean working directory
Expand All @@ -163,17 +152,7 @@ jobs:
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install chromium
- name: Install Playwright system dependencies
run: yarn playwright install-deps chromium
- uses: ./.github/actions/playwright-install
- run: VITE_DB_FOLDER=e2e yarn build
- name: Run E2E tests
id: e2e
Expand Down
23 changes: 4 additions & 19 deletions scripts/playwright-install.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
#!/bin/bash

# Skip in Dependabot environments (not needed and causes failures)
if "$(dirname "$0")/utils/check-dependabot.sh"; then
echo "⏭️ Skipping Playwright install in Dependabot environment"
exit 0
fi

# Also respect PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD for CI environments
if [ "$PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD" = "1" ]; then
echo "⏭️ Skipping Playwright install (PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1)"
# In CI, browsers are installed separately via the playwright-install composite action
if [ "$CI" = "true" ]; then
echo "⏭️ Skipping Playwright install in CI"
exit 0
fi

# Install Chromium (with system deps in CI, headless shell only if requested)
if [ "$CI" = "true" ]; then
if [ "$PLAYWRIGHT_ONLY_SHELL" = "1" ]; then
yarn playwright install --with-deps --only-shell chromium
else
yarn playwright install --with-deps chromium
fi
else
yarn playwright install chromium
fi
yarn playwright install --with-deps chromium
Loading