-
Notifications
You must be signed in to change notification settings - Fork 166
60 lines (48 loc) · 1.96 KB
/
build-test-package.yml
File metadata and controls
60 lines (48 loc) · 1.96 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
name: Build, test, package
on: [push,pull_request]
concurrency:
group: '${{ github.workflow }}@${{ github.head_ref || github.run_id }}'
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
cxx-build-workflow:
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.5
python-build-workflow:
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.5
with:
cmake-options: '-DRTK_BUILD_APPLICATIONS:BOOL=OFF'
python3-minor-versions: ${{ github.event_name == 'pull_request' && '["11"]' || '["9","10","11"]' }}
itk-python-package-tag: 'release-5.4'
secrets:
pypi_password: ${{ secrets.pypi_password }}
test-python-wheel:
needs:
- python-build-workflow
runs-on: self-hosted-linux
steps:
- uses: actions/checkout@v4
- name: Download all wheel artifacts
uses: actions/download-artifact@v4
with:
path: wheels
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Test python wheel
run: |
# Find wheel for Python 3.11 dynamically
wheel=$(find wheels -name "*cp311*manylinux_2_28_x86_64.whl" -type f | head -1)
pip uninstall -y $(pip list | grep -E '^itk-') || true
echo "Installing wheel: $wheel"
pip install $wheel
pip install pytest matplotlib
# Run tests with warning detection.
# SWIG < 4.4 triggers the Py_LIMITED_API "builtin type swig…" warning when
# Python runs with -Walways; pytest enables that behavior, so we ignore it.
stderr_log=$(mktemp)
pytest $GITHUB_WORKSPACE/test/*.py -vv -s -W "ignore:builtin type swig" 2> "$stderr_log"
if grep -q "Warning" "$stderr_log"; then
echo "Warnings found in stderr, failing the build"
cat "$stderr_log"
exit 1
fi