Skip to content
Open
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
32 changes: 32 additions & 0 deletions .github/actions/setup-playwright/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Setup and Cache Playwright'
description: 'Installs playwright browsers and caches them.'

inputs:
version:
description: 'The version of playwright'
required: true

outputs:
cache-hit:
description: 'Whether the cache was hit or not'
value: ${{ steps.playwright-cache.outputs.cache-hit }}

runs:
using: 'composite'
steps:
- name: Cache playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
key: playwright-browsers-${{ runner.os }}-${{ inputs.version }}
path: ~/.cache/ms-playwright

- name: Install playwright browsers if they don't exist
shell: bash
run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Install playwright dependencies if binaries exist
shell: bash
run: npx playwright install-deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@ jobs:
run: npm ci --ignore-scripts
- name: Build libs
run: npm run build
- name: Get playwright version
run: echo "PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')" >> $GITHUB_ENV
- name: Setup playwright
uses: ./.github/actions/setup-playwright
with:
version: ${{ env.PLAYWRIGHT_VERSION }}
- name: Tests
run: npm run test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@jsr:registry=https://npm.jsr.io
Loading