Skip to content

chore: build the driver and the generated files from a pinned microsoft/playwright commit #4919

chore: build the driver and the generated files from a pinned microsoft/playwright commit

chore: build the driver and the generated files from a pinned microsoft/playwright commit #4919

Workflow file for this run

name: CI
on:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
- release-*
concurrency:
# For pull requests, cancel all currently-running jobs for this workflow
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
infra:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -r requirements.txt
pip install -e .
- name: Get Playwright
run: python scripts/upstream.py checkout
- name: Lint
run: pre-commit run --show-diff-on-failure --color=always --all-files
- name: Check the tests against the upstream test registry
run: python scripts/check_test_registry.py --report
- name: Check that the generated files are up to date
run: |
./scripts/update_api.sh
git diff --exit-code
build:
name: Build
timeout-minutes: 90
env:
# The dot reporter of the test steps (scripts/pytest_dot_reporter.py).
PYTHONPATH: scripts
# 16 workers on the 64-core runners, as upstream runs its tests there; two on
# the 3-core macOS runner, upstream's default of half the cores.
WORKERS: ${{ startsWith(matrix.os, 'macos') && '2' || '16' }}
strategy:
fail-fast: false
matrix:
# Linux and Windows run on the 64-core runners of the organization, as
# upstream's tests_primary.yml; macOS on the hosted runner.
# 3.12 is our most used Python version (base)
os: [playwright-x64-ubuntu24-64-core, playwright-x64-server2025-64-core, macos-15-xlarge]
python-version: ['3.12']
browser: [chromium, firefox, webkit]
include:
- os: playwright-x64-server2025-64-core
python-version: '3.10'
browser: chromium
- os: macos-15-xlarge
python-version: '3.10'
browser: chromium
- os: playwright-x64-ubuntu24-64-core
python-version: '3.10'
browser: chromium
- os: playwright-x64-server2025-64-core
python-version: '3.11'
browser: chromium
- os: macos-15-xlarge
python-version: '3.11'
browser: chromium
- os: playwright-x64-ubuntu24-64-core
python-version: '3.11'
browser: chromium
- os: playwright-x64-server2025-64-core
python-version: '3.13'
browser: chromium
- os: macos-15-xlarge
python-version: '3.13'
browser: chromium
- os: playwright-x64-ubuntu24-64-core
python-version: '3.13'
browser: chromium
- os: playwright-x64-server2025-64-core
python-version: '3.14'
browser: chromium
- os: macos-15-xlarge
python-version: '3.14'
browser: chromium
- os: playwright-x64-ubuntu24-64-core
python-version: '3.14'
browser: chromium
# Intel macOS, once: *-large is Intel, *-xlarge is arm64, as upstream notes.
- os: macos-15-large
python-version: '3.12'
browser: chromium
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -r requirements.txt
pip install -e .
- name: Get Playwright
run: python scripts/upstream.py checkout
- name: Build the driver and the wheel
run: python -m build --wheel
- name: Install browsers
id: install
run: python -m playwright install --with-deps ${{ matrix.browser }}
- name: Common Tests
run: pytest tests/common --browser=${{ matrix.browser }}
- name: Test Reference count
run: pytest tests/test_reference_count_async.py --browser=${{ matrix.browser }}
- name: Test Wheel Installation
run: pytest tests/test_installation.py --browser=${{ matrix.browser }}
- name: Test Sync API
if: runner.os != 'Linux'
run: pytest tests/sync --browser=${{ matrix.browser }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
- name: Test Sync API
if: runner.os == 'Linux'
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" pytest tests/sync --browser=${{ matrix.browser }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
- name: Test Async API
# Also after a failed sync step: the two suites report on their own.
if: ${{ !cancelled() && steps.install.outcome == 'success' && runner.os != 'Linux' }}
run: pytest tests/async --browser=${{ matrix.browser }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
- name: Test Async API
if: ${{ !cancelled() && steps.install.outcome == 'success' && runner.os == 'Linux' }}
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" pytest tests/async --browser=${{ matrix.browser }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
test-stable:
name: Stable
# The branded browsers on the 3-core macOS runner take longer than the bundled ones.
timeout-minutes: 120
env:
# The dot reporter of the test steps (scripts/pytest_dot_reporter.py).
PYTHONPATH: scripts
WORKERS: ${{ startsWith(matrix.os, 'macos') && '2' || '16' }}
strategy:
fail-fast: false
matrix:
os: [playwright-x64-ubuntu24-64-core, playwright-x64-server2025-64-core, macos-15-xlarge]
browser-channel: [chrome]
include:
- os: playwright-x64-server2025-64-core
browser-channel: msedge
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -r requirements.txt
pip install -e .
- name: Get Playwright
run: python scripts/upstream.py checkout
- name: Build the driver and the wheel
run: python -m build --wheel
- name: Install browsers
id: install
run: python -m playwright install ${{ matrix.browser-channel }} --with-deps
- name: Common Tests
run: pytest tests/common --browser=chromium --browser-channel=${{ matrix.browser-channel }}
- name: Test Sync API
if: runner.os != 'Linux'
run: pytest tests/sync --browser=chromium --browser-channel=${{ matrix.browser-channel }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
- name: Test Sync API
if: runner.os == 'Linux'
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" pytest tests/sync --browser=chromium --browser-channel=${{ matrix.browser-channel }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
- name: Test Async API
# Also after a failed sync step: the two suites report on their own.
if: ${{ !cancelled() && steps.install.outcome == 'success' && runner.os != 'Linux' }}
run: pytest tests/async --browser=chromium --browser-channel=${{ matrix.browser-channel }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
- name: Test Async API
if: ${{ !cancelled() && steps.install.outcome == 'success' && runner.os == 'Linux' }}
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" pytest tests/async --browser=chromium --browser-channel=${{ matrix.browser-channel }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
test_examples:
name: Examples
runs-on: ubuntu-22.04
defaults:
run:
working-directory: examples/todomvc/
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.10'
- name: Install dependencies & browsers
id: install
run: |
pip install -r requirements.txt
python -m playwright install --with-deps chromium
- name: Common Tests
run: pytest