-
-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (65 loc) · 2.91 KB
/
Copy pathpython.yml
File metadata and controls
68 lines (65 loc) · 2.91 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
name: Python Adapter
# Triggered by packages/shared/src/** as well, because the adapter's wire
# contract is GENERATED from it: scope names, the runner id, the collector route,
# the worker query keys and the run-id env var. A rename there leaves the
# committed `_contract.py` stale, and stale means the adapter keeps sending a name
# nothing reads — a silent loss, not an error.
#
# This was previously excluded to keep a Python job off every PR that touches
# shared. The objection was that a red Python job would block work unrelated to
# this adapter; it does not hold, because the only thing a shared change can turn
# red here is the drift check, and drift IS related — it means that PR broke this
# contract. The tests do not read shared at all. Scoped to `src/` so a version
# bump or a README edit under shared does not trigger it.
on:
push:
branches:
- main
paths:
- packages/selenium-devtools-py/**
- packages/shared/src/**
- .github/workflows/python.yml
- .github/workflows/python-release.yml
- .github/actions/python-package/**
pull_request:
paths:
- packages/selenium-devtools-py/**
- packages/shared/src/**
- .github/workflows/python.yml
- .github/workflows/python-release.yml
- .github/actions/python-package/**
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# The floor the package declares, and the newest — 3.10 because selenium
# 4.44 requires it, and network capture requires 4.44+.
python-version: ['3.10', '3.13']
steps:
# Full history: the change-fragment gate diffs this branch against the
# base, which a depth-1 checkout cannot see.
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python-version }}
# A source change with no fragment is a release that cannot describe
# itself, and the version it would ship is decided by these files.
- name: Source changes carry a change fragment
if: github.event_name == 'pull_request'
working-directory: packages/selenium-devtools-py
env:
BASE_REF: ${{ github.base_ref }}
run: python scripts/changes.py check --base "origin/$BASE_REF"
- uses: ./.github/actions/python-package
# The pin is the backend a `pip install` user actually runs, and the drift
# check above cannot see it: that compares `_contract.py` against shared,
# this compares it against the tarball npm serves. Red here means the next
# PyPI release would ship features the pinned backend cannot answer.
- name: Pinned backend serves this adapter's contract
working-directory: packages/selenium-devtools-py
run: python scripts/check_backend_pin.py