|
12 | 12 | - main |
13 | 13 |
|
14 | 14 | jobs: |
| 15 | + unit_tests: |
| 16 | + if: github.event_name == 'pull_request' |
| 17 | + name: Unit tests on ${{ matrix.os }} / Python ${{ matrix.python }} |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + timeout-minutes: 30 |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + os: [ubuntu-latest, macos-14, windows-latest] |
| 24 | + python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + submodules: recursive |
| 29 | + - uses: actions/setup-python@v5 |
| 30 | + with: |
| 31 | + python-version: ${{ matrix.python }} |
| 32 | + - name: Install dependencies |
| 33 | + run: | |
| 34 | + python -m pip install --upgrade pip wheel setuptools |
| 35 | + python -m pip install numpy pytest |
| 36 | + - name: Build and install |
| 37 | + run: python -m pip install -e . |
| 38 | + - name: Run tests |
| 39 | + run: pytest tests -vv |
| 40 | + |
15 | 41 | build_wheels: |
16 | 42 | name: Build wheels on ${{ matrix.os }} |
17 | 43 | runs-on: ${{ matrix.os }} |
| 44 | + timeout-minutes: 90 |
18 | 45 | strategy: |
19 | 46 | # Ensure that a wheel builder finishes even if another fails |
20 | 47 | fail-fast: false |
@@ -286,12 +313,14 @@ jobs: |
286 | 313 | CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux_image }} |
287 | 314 | CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} |
288 | 315 | CIBW_BEFORE_BUILD: pip install pybind11 |
289 | | - CIBW_TEST_COMMAND: python {project}/tests/_ci_debug_import.py && pytest {project}/tests -vv |
290 | | - CIBW_TEST_COMMAND_WINDOWS: python {project}\tests\_ci_debug_import.py && pytest {project}\tests -vv |
| 316 | + CIBW_TEST_COMMAND: python {project}/tests/_ci_test_runner.py |
| 317 | + CIBW_TEST_COMMAND_WINDOWS: python {project}\tests\_ci_test_runner.py |
291 | 318 | CIBW_TEST_REQUIRES: pytest numpy |
| 319 | + CIBW_TEST_SKIP: ${{ github.event_name == 'pull_request' && '*' || '' }} |
292 | 320 | CIBW_BUILD_VERBOSITY: 1 |
293 | 321 | CIBW_ARCHS: ${{ matrix.arch }} |
294 | 322 | MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }} |
| 323 | + CIBW_ENVIRONMENT: CIBW_PLATFORM_ID=${{ matrix.platform_id }} |
295 | 324 | - uses: actions/upload-artifact@v4 |
296 | 325 | with: |
297 | 326 | name: wheels-${{ matrix.platform_id }}-py${{ matrix.python }} |
|
0 commit comments