datasette/.github/workflows/playwright.yml
Alex Garcia 063eeae83d
Slim down CI runs per commit (#2911)
- Only run push-triggered workflows on main; PRs are covered by
  pull_request, so branch commits no longer run everything twice
- Test SQLite versions: single job, Python 3.13 + SQLite 3.25
- Fold coverage into the Python 3.14 test job (including serial
  tests) and remove test-coverage.yml; bump codecov-action to v5
- Cancel superseded in-progress runs on pull requests
- Prettier now also runs on pull requests

Claude-Session: https://claude.ai/code/session_012G7fa8HqJy9AkSjkocetAz
2026-09-15 08:51:24 -07:00

54 lines
1.6 KiB
YAML

name: Playwright
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
steps:
- uses: actions/checkout@v7
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"
allow-prereleases: true
cache: pip
cache-dependency-path: pyproject.toml
- name: Cache uv
uses: actions/cache@v6
with:
path: ~/.cache/uv
key: ${{ runner.os }}-py3.14-uv-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-py3.14-uv-
- name: Cache Playwright browsers
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-${{ matrix.browser }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-playwright-${{ matrix.browser }}-
- name: Install uv
run: python -m pip install uv
- name: Install dependencies
run: uv sync --group dev --group playwright
- name: Install ${{ matrix.browser }}
run: uv run --group dev --group playwright playwright install --with-deps ${{ matrix.browser }}
- name: Run Playwright tests
run: uv run --group dev --group playwright pytest tests/test_playwright.py --playwright --browser ${{ matrix.browser }}