Repository navigation
223 lines (217 loc) · 8.95 KB
/
Copy pathci.yml
File metadata and controls
223 lines (217 loc) · 8.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
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: ./scripts/lint.sh
env:
PRE_COMMIT_COLOR: always
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