From cc8bd78b3ebc6c451feb97a9662e6bf4ff139406 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 14 Jan 2022 20:16:03 -0500 Subject: [PATCH] Run wheel builds on PRs when requested by a label --- .github/workflows/cibuildwheel.yml | 15 +++++++++++++++ doc/devel/coding_guide.rst | 2 ++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index d969ad38d36e..39b9c46d61a4 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,15 +1,30 @@ name: Build CI wheels on: + # Save CI by only running this on release branches or tags. push: branches: - main - v[0-9]+.[0-9]+.x tags: - v* + # Also allow running this action on PRs if requested by applying the + # "Run cibuildwheel" label. + pull_request: + types: + - opened + - synchronize + - reopened + - labeled jobs: build_wheels: + if: | + ( + github.event.action == 'labeled' && + github.event.label.name == 'Run cibuildwheel' + ) || + contains(github.event.pull_request.labels.*.name, 'Run cibuildwheel') name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} env: diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst index b413457370ad..2ff18bb8f1f0 100644 --- a/doc/devel/coding_guide.rst +++ b/doc/devel/coding_guide.rst @@ -123,6 +123,8 @@ Labels * If you have the rights to set labels, tag the PR with descriptive labels. See the `list of labels `__. +* If the PR makes changes to the wheel building Action, add the + "Run cibuildwheel" label to enable testing wheels. .. _pr-milestones: