Skip to content

Commit 44eec28

Browse files
committed
Run a smaller subset of targets on pull requests by default
1 parent 0b479df commit 44eec28

6 files changed

Lines changed: 262 additions & 59 deletions

File tree

.github/workflows/linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ jobs:
178178
--platform linux \
179179
--labels "${STEPS_GET_LABELS_OUTPUTS_LABELS}" \
180180
--max-shards 2 \
181+
--event ${{ github.event_name }} \
181182
${{ (steps.check-pythonbuild.outputs.changed == 'true' || github.ref == 'refs/heads/main') && '--force-crate-build' || '' }} \
182183
> matrix.json
183184

.github/workflows/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Generate build matrix
9393
id: set-matrix
9494
run: |
95-
uv run ci-matrix.py --platform darwin --labels "${STEPS_GET_LABELS_OUTPUTS_LABELS}" ${{ (steps.check-pythonbuild.outputs.changed == 'true' || github.ref == 'refs/heads/main') && '--force-crate-build' || '' }} > matrix.json
95+
uv run ci-matrix.py --platform darwin --labels "${STEPS_GET_LABELS_OUTPUTS_LABELS}" --event ${{ github.event_name }} ${{ (steps.check-pythonbuild.outputs.changed == 'true' || github.ref == 'refs/heads/main') && '--force-crate-build' || '' }} > matrix.json
9696
9797
# Extract python-build matrix
9898
echo "matrix=$(jq -c '."python-build"' matrix.json)" >> $GITHUB_OUTPUT

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Generate build matrix
9393
id: set-matrix
9494
run: |
95-
uv run ci-matrix.py --platform windows --labels "${STEPS_GET_LABELS_OUTPUTS_LABELS}" ${{ (steps.check-pythonbuild.outputs.changed == 'true' || github.ref == 'refs/heads/main') && '--force-crate-build' || '' }} > matrix.json
95+
uv run ci-matrix.py --platform windows --labels "${STEPS_GET_LABELS_OUTPUTS_LABELS}" --event ${{ github.event_name }} ${{ (steps.check-pythonbuild.outputs.changed == 'true' || github.ref == 'refs/heads/main') && '--force-crate-build' || '' }} > matrix.json
9696
9797
# Extract python-build matrix
9898
echo "matrix=$(jq -c '."python-build"' matrix.json)" >> $GITHUB_OUTPUT

CONTRIBUTING.rst

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,36 @@ Building distributions
88
See the [documentation](https://gregoryszorc.com/docs/python-build-standalone/main/building.html)
99
for instructions on building distributions locally.
1010

11-
CI labels
12-
=========
13-
By default, submitting a pull request triggers a complete build of all
14-
distributions in CI, which can be time-consuming.
11+
Pull request labels
12+
===================
13+
By default, pull requests build a small subset of targets defined in
14+
``pr-targets.yaml``. Pushes to ``main`` build the full matrix from
15+
``ci-targets.yaml``.
1516

16-
To conserve CI resources and reduce build times, you can limit the matrix of
17-
distributions built by applying specific labels to your pull request. Only
18-
distributions matching the specified labels will be built.
17+
Pull request labels can be used to change what CI builds:
1918

20-
The following label prefixes can be used to customize the build matrix:
19+
* ``platform:<value>`` filters the selected targets by platform.
20+
* ``arch:<value>`` filters the selected targets by architecture.
21+
* ``libc:<value>`` filters the selected targets by libc.
22+
* ``python:<value>`` replaces the default Python version.
23+
* ``build:<value>`` replaces the default build options.
2124

22-
* `platform`
23-
* `python`
24-
* `build`
25-
* `arch`
26-
* `libc`
25+
The following labels expand the default pull request matrix:
2726

28-
To bypass CI entirely for changes that do not affect the build (such as
29-
documentation updates), use the `ci:skip` label.
27+
* ``platform:all`` uses all targets from ``ci-targets.yaml``.
28+
* ``python:all`` uses all Python versions from ``ci-targets.yaml``.
29+
* ``build:all`` uses all build options from ``ci-targets.yaml``.
30+
* ``ci:all-targets`` bypasses ``pr-targets.yaml`` and uses ``ci-targets.yaml``.
3031

31-
Please utilize these tags when appropriate for your changes to minimize CI
32-
resource consumption.
32+
Examples:
33+
34+
* ``platform:linux`` builds only the Linux targets from ``pr-targets.yaml``.
35+
* ``python:3.13`` builds the default targets with Python 3.13.
36+
* ``platform:all,platform:linux,python:all`` builds the full Linux matrix.
37+
38+
To bypass CI entirely for changes that do not affect the build, use the
39+
``ci:skip`` label. The ``documentation`` label is treated the same way. To run
40+
a dry-run build matrix, use ``ci:dry-run``.
3341

3442
Releases
3543
========

0 commit comments

Comments
 (0)