@@ -10,14 +10,15 @@ jobs:
1010 strategy :
1111 fail-fast : false
1212 matrix :
13- os : [ubuntu-latest]
13+ os : [ubuntu-latest, windows-latest, macos-latest ]
1414
1515 steps :
1616 - uses : actions/checkout@v4
1717
1818 - name : Build wheels
19- uses : pypa/cibuildwheel@v2.22.0
19+ uses : pypa/cibuildwheel@v3.0.1
2020 env :
21+ SPIRIT_ADD_VERSION_SUFFIX : ${{ github.ref == 'refs/heads/master' }}
2122 CIBW_BUILD : >
2223 cp311-*
2324 cp312-*
@@ -27,13 +28,18 @@ jobs:
2728 *-win32
2829 *_i686
2930 CIBW_BEFORE_BUILD : >
30- cmake -B build -S .
31+ python -m pip install --upgrade pip
32+ && pip install numpy
33+ && cmake -B build -S .
34+ -DPython3_FIND_STRATEGY=LOCATION
3135 -DCMAKE_BUILD_TYPE=Release
3236 -DSPIRIT_BUILD_FOR_PYTHON=ON
33- -DSPIRIT_BUILD_TEST=OFF
37+ -DSPIRIT_BUILD_TEST=ON
3438 -DSPIRIT_UI_CXX_USE_QT=OFF
3539 -DSPIRIT_UI_IMGUI=OFF
36- && cmake --build build -j2
40+ && cmake --build build --config Release -j2
41+ && ctest -C Release --test-dir build --output-on-failure
42+ && echo "Add version suffix: $SPIRIT_ADD_VERSION_SUFFIX"
3743 CIBW_MANYLINUX_X86_64_IMAGE : manylinux_2_28
3844 with :
3945 package-dir : ./core/python
4248
4349 - uses : actions/upload-artifact@v4
4450 with :
45- name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
51+ name : cibw-wheels-${{ matrix.os }}
4652 path : ./wheelhouse/*.whl
53+
54+ install_wheels :
55+ name : Install wheels on ${{ matrix.os }} (python-${{ matrix.python }})
56+ runs-on : ${{ matrix.os }}
57+ needs : build_wheels
58+ strategy :
59+ fail-fast : false
60+ matrix :
61+ os : [ubuntu-latest, windows-latest, macos-latest]
62+ python : ["3.11", "3.12"]
63+
64+ steps :
65+ - name : Set up Python ${{ matrix.python }}
66+ uses : actions/setup-python@v4
67+ with :
68+ python-version : ${{ matrix.python }}
69+
70+ - name : Download built wheels
71+ uses : actions/download-artifact@v4
72+ with :
73+ name : cibw-wheels-${{ matrix.os }}
74+ path : wheelhouse
75+
76+ - name : Install wheel in a clean env
77+ shell : bash
78+ run : |
79+ python -m pip install --upgrade pip
80+ pip install wheelhouse/*.whl
81+
82+ - name : Smoke‑test import
83+ shell : bash
84+ run : |
85+ python - <<'EOF'
86+ import spirit
87+ print("Imported version:", spirit.__version__)
88+ from spirit import state
89+ with state.State(quiet=False) as p_state:
90+ pass
91+ EOF
0 commit comments