Skip to content

Commit d29d210

Browse files
authored
devops(ci): use the shared CI environment action from microsoft/playwright (#3297)
1 parent 47ea9fa commit d29d210

2 files changed

Lines changed: 18 additions & 84 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ jobs:
103103
python-version: '3.12'
104104
browser: chromium
105105
runs-on: ${{ matrix.os }}
106+
defaults:
107+
run:
108+
shell: bash
106109
steps:
107110
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
111+
- uses: microsoft/playwright/.github/actions/ci-env@main
108112
- name: Set up Python
109113
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
110114
with:
@@ -127,34 +131,17 @@ jobs:
127131
id: install
128132
run: python -m playwright install --with-deps ${{ matrix.browser }}
129133
- name: Common Tests
130-
run: |
131-
${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }}
132-
pytest tests/common --browser=${{ matrix.browser }}
134+
run: $CI_ENV_EXEC pytest tests/common --browser=${{ matrix.browser }}
133135
- name: Test Reference count
134-
run: |
135-
${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }}
136-
pytest tests/test_reference_count_async.py --browser=${{ matrix.browser }}
136+
run: $CI_ENV_EXEC pytest tests/test_reference_count_async.py --browser=${{ matrix.browser }}
137137
- name: Test Wheel Installation
138-
run: |
139-
${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }}
140-
pytest tests/test_installation.py --browser=${{ matrix.browser }}
141-
- name: Test Sync API
142-
if: runner.os != 'Linux'
143-
run: |
144-
${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }}
145-
pytest tests/sync --browser=${{ matrix.browser }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
138+
run: $CI_ENV_EXEC pytest tests/test_installation.py --browser=${{ matrix.browser }}
146139
- name: Test Sync API
147-
if: runner.os == 'Linux'
148-
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
140+
run: $CI_ENV_EXEC pytest tests/sync --browser=${{ matrix.browser }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
149141
- name: Test Async API
150142
# Also after a failed sync step: the two suites report on their own.
151-
if: ${{ !cancelled() && steps.install.outcome == 'success' && runner.os != 'Linux' }}
152-
run: |
153-
${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }}
154-
pytest tests/async --browser=${{ matrix.browser }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
155-
- name: Test Async API
156-
if: ${{ !cancelled() && steps.install.outcome == 'success' && runner.os == 'Linux' }}
157-
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
143+
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
144+
run: $CI_ENV_EXEC pytest tests/async --browser=${{ matrix.browser }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
158145

159146
test-stable:
160147
name: Stable
@@ -173,8 +160,12 @@ jobs:
173160
- os: playwright-x64-server2025-64-core
174161
browser-channel: msedge
175162
runs-on: ${{ matrix.os }}
163+
defaults:
164+
run:
165+
shell: bash
176166
steps:
177167
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
168+
- uses: microsoft/playwright/.github/actions/ci-env@main
178169
- name: Set up Python
179170
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
180171
with:
@@ -197,26 +188,13 @@ jobs:
197188
id: install
198189
run: python -m playwright install ${{ matrix.browser-channel }} --with-deps
199190
- name: Common Tests
200-
run: |
201-
${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }}
202-
pytest tests/common --browser=chromium --browser-channel=${{ matrix.browser-channel }}
191+
run: $CI_ENV_EXEC pytest tests/common --browser=chromium --browser-channel=${{ matrix.browser-channel }}
203192
- name: Test Sync API
204-
if: runner.os != 'Linux'
205-
run: |
206-
${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }}
207-
pytest tests/sync --browser=chromium --browser-channel=${{ matrix.browser-channel }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
208-
- name: Test Sync API
209-
if: runner.os == 'Linux'
210-
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
193+
run: $CI_ENV_EXEC pytest tests/sync --browser=chromium --browser-channel=${{ matrix.browser-channel }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
211194
- name: Test Async API
212195
# Also after a failed sync step: the two suites report on their own.
213-
if: ${{ !cancelled() && steps.install.outcome == 'success' && runner.os != 'Linux' }}
214-
run: |
215-
${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }}
216-
pytest tests/async --browser=chromium --browser-channel=${{ matrix.browser-channel }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
217-
- name: Test Async API
218-
if: ${{ !cancelled() && steps.install.outcome == 'success' && runner.os == 'Linux' }}
219-
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
196+
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
197+
run: $CI_ENV_EXEC pytest tests/async --browser=chromium --browser-channel=${{ matrix.browser-channel }} -n ${{ env.WORKERS }} -p pytest_dot_reporter -rfE --color=yes
220198

221199
test_examples:
222200
name: Examples

‎scripts/windows-normal-io.ps1‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)