Skip to content

Commit 4c8355b

Browse files
committed
Enhance CI workflows by adding conditional execution for manual runs and ensuring numpy availability for testing in release process
1 parent d87afa5 commit 4c8355b

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ on:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8+
# Allow manual runs even if disabled via variable
9+
workflow_dispatch:
810

911
jobs:
1012
build:
13+
# Skip on push/PR when repo variable DISABLE_BUILD_AND_TEST == 'true'.
14+
# Still allow manual runs via the Actions tab.
15+
if: ${{ vars.DISABLE_BUILD_AND_TEST != 'true' || github.event_name == 'workflow_dispatch' }}
1116
strategy:
1217
fail-fast: false
1318
matrix:

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ jobs:
8282
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
8383
bash -lc 'LD_LIBRARY_PATH=/opt/fftw/lib auditwheel repair -w {dest_dir} {wheel}'
8484
85-
# Quick import + tiny run test inside the wheel env
86-
CIBW_TEST_COMMAND: >
85+
# Ensure numpy is available for the test snippet
86+
CIBW_TEST_REQUIRES: numpy
87+
# Quick import + tiny run test inside the wheel env (use literal block to preserve newlines)
88+
CIBW_TEST_COMMAND: |
8789
python - <<'PY'
8890
import numpy as np, cpp_hf
8991
nk,d=4,2
@@ -139,7 +141,8 @@ jobs:
139141
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
140142
bash -lc 'delocate-listdeps -d {wheel} || true; MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} delocate-wheel -L /opt/homebrew/lib -L /usr/local/lib --require-archs {delocate_archs} -w {dest_dir} -v {wheel}'
141143
142-
CIBW_TEST_COMMAND: >
144+
CIBW_TEST_REQUIRES: numpy
145+
CIBW_TEST_COMMAND: |
143146
python - <<'PY'
144147
import numpy as np, cpp_hf
145148
nk,d=4,2

0 commit comments

Comments
 (0)