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
36 changes: 36 additions & 0 deletions .github/actions/setup-playwright/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Setup Playwright"
description: "Install Playwright browsers and dependencies with caching"
inputs:
browsers:
description: "Space-separated list of browsers to install (e.g., 'chromium', 'chromium webkit')"
required: false
default: "chromium"
runs:
using: "composite"
steps:
- name: Get Playwright version
id: playwright-version
shell: bash
run: |
# Extract Playwright version from bun.lock
VERSION=$(grep -A1 '"playwright":' bun.lock | grep -oP '"\K[0-9]+\.[0-9]+\.[0-9]+' | head -1)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Playwright version: $VERSION"

- name: Cache Playwright browsers
id: cache-playwright
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}-${{ inputs.browsers }}
restore-keys: |
${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}-

- name: Install Playwright browsers
if: steps.cache-playwright.outputs.cache-hit != 'true'
shell: bash
run: bun x playwright install ${{ inputs.browsers }}

- name: Install Playwright system dependencies
shell: bash
run: bun x playwright install-deps ${{ inputs.browsers }}
11 changes: 3 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ jobs:

- uses: ./.github/actions/setup-mux

- name: Install Playwright browsers
run: bun x playwright install --with-deps
- uses: ./.github/actions/setup-playwright

- name: Build Storybook
run: make storybook-build
Expand All @@ -160,16 +159,12 @@ jobs:

- uses: ./.github/actions/setup-mux

- name: Install system dependencies
- name: Install xvfb
run: |
sudo apt-get update
sudo apt-get install -y xvfb

- name: Install Playwright runtime dependencies
run: bun x playwright install-deps

- name: Install Playwright browsers
run: bun x playwright install --with-deps
- uses: ./.github/actions/setup-playwright

- name: Run e2e tests
run: xvfb-run -a make test-e2e
Expand Down