Skip to content

Commit 6bd9cf6

Browse files
committed
Use environment variable for build_all
1 parent 573cff7 commit 6bd9cf6

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

.github/workflows/wheel.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ concurrency:
66
group: ${{ github.workflow }}-${{ github.ref }}
77
cancel-in-progress: true
88

9+
env:
10+
# Build all wheels on either:
11+
# - tagged release
12+
# - pull request opened with "test all wheels" label
13+
# - pull requests when "test all wheels" label is added
14+
BUILD_ALL: |
15+
${{
16+
(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v'))
17+
|| contains(github.event.pull_request.labels.*.name, 'test all wheels')
18+
|| (github.event.action == 'labeled' && github.event.label.name == 'test all wheels')
19+
}}
20+
921
jobs:
1022
build_wheels:
1123
name: Build wheels on ${{ matrix.os }}
@@ -15,16 +27,6 @@ jobs:
1527
matrix:
1628
# macos-13 is an intel runner, macos-14 is a arm64 runner
1729
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
18-
# Build all wheels on either:
19-
# - tagged release
20-
# - pull request opened with "test all wheels" label
21-
# - pull requests when "test all wheels" label is added
22-
build_all: |
23-
${{
24-
(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v'))
25-
|| contains(github.event.pull_request.labels.*.name, 'test all wheels')
26-
|| (github.event.action == 'labeled' && github.event.label.name == 'test all wheels')
27-
}}
2830
env:
2931
CIBW_TEST_COMMAND: python -c "import numcodecs"
3032
CIBW_BUILD: "cp311-* cp312-* cp313-*"
@@ -39,7 +41,7 @@ jobs:
3941
submodules: true
4042

4143
- name: Restrict number of wheel builds on PRs
42-
if: ${{ !matrix.build_all }}
44+
if: ${{ !env.BUILD_ALL }}
4345
run: |
4446
echo "CIBW_BUILD=cp310-win_amd64 cp311-manylinux_x86_64 cp312-macosx_x86_64 cp312-macosx_arm64" >> $GITHUB_ENV
4547

0 commit comments

Comments
 (0)