Spectralvectorimage #2205
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/[email protected] | |
| python-build-workflow: | |
| uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/[email protected] | |
| 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 | |
| strategy: | |
| matrix: | |
| include: | |
| - runs-on: ubuntu-22.04 | |
| wheel-pattern: "*cp311*manylinux_2_28_x86_64.whl" | |
| - runs-on: windows-latest | |
| wheel-pattern: "*cp311*win*.whl" | |
| - runs-on: macos-latest | |
| wheel-pattern: "*cp311*macosx_*.whl" | |
| runs-on: ${{ matrix.runs-on }} | |
| 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 | |
| shell: bash | |
| run: | | |
| # Find wheel for Python 3.11 dynamically | |
| wheel=$(find wheels -name "${{ matrix.wheel-pattern }}" -type f | head -1) | |
| python -m venv .venv | |
| if [[ "${{ matrix.runs-on }}" == "windows-latest" ]]; then | |
| source .venv/Scripts/activate | |
| else | |
| source .venv/bin/activate | |
| fi | |
| trap 'deactivate >/dev/null 2>&1 || true; rm -rf .venv' EXIT | |
| 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. | |
| test_log=$(mktemp) | |
| pytest -vv -s -W error -W "ignore:builtin type swig" 2>&1 | tee "$test_log" | |
| matches=$(grep -Ei "warning|exception|redefin(ed|ition)?" "$test_log" || true) | |
| if [ -n "$matches" ]; then | |
| echo "Unexpected output found:" | |
| echo "$matches" | |
| exit 1 | |
| fi |