Preparing Lesson E of tutorial #819
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
| # This file generates Python wheels for Windows | |
| on: | |
| push: | |
| branches: | |
| - codac1 | |
| - codac2 | |
| - codac2_codac4matlab | |
| tags-ignore: ['**'] # Ignore all tag pushes | |
| pull_request: | |
| jobs: | |
| vcmatrix: | |
| runs-on: ${{ matrix.cfg.os }} | |
| defaults: | |
| run: | |
| shell: ${{ matrix.cfg.shell }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cfg: | |
| # Should be Visual Studio 2015 for Python 3.5-3.7, Visual Studio 2019 for Python 3.8-3.10, but need at least Visual Studio 2022 for C++20 compatibility...? | |
| - { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 14, desc: 'Windows Visual Studio 2022 x86 Python 3.14' } | |
| - { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 13, desc: 'Windows Visual Studio 2022 x86 Python 3.13' } | |
| - { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 12, desc: 'Windows Visual Studio 2022 x86 Python 3.12' } | |
| - { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 11, desc: 'Windows Visual Studio 2022 x86 Python 3.11' } | |
| - { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 10, desc: 'Windows Visual Studio 2022 x86 Python 3.10' } | |
| - { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 9 , desc: 'Windows Visual Studio 2022 x86 Python 3.9' } | |
| - { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 8 , desc: 'Windows Visual Studio 2022 x86 Python 3.8' } | |
| - { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 14, desc: 'Windows Visual Studio 2022 x64 Python 3.14' } | |
| - { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 13, desc: 'Windows Visual Studio 2022 x64 Python 3.13' } | |
| - { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 12, desc: 'Windows Visual Studio 2022 x64 Python 3.12' } | |
| - { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 11, desc: 'Windows Visual Studio 2022 x64 Python 3.11' } | |
| - { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 10, desc: 'Windows Visual Studio 2022 x64 Python 3.10' } | |
| - { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 9 , desc: 'Windows Visual Studio 2022 x64 Python 3.9' } | |
| - { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 8 , desc: 'Windows Visual Studio 2022 x64 Python 3.8' } | |
| name: ${{ matrix.cfg.desc }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| clean: false | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.cfg.py_v_maj }}.${{ matrix.cfg.py_v_min }} | |
| architecture: ${{ matrix.cfg.arch }} | |
| if: matrix.cfg.py_v_maj!='' | |
| - run: | | |
| python -c "import sys; print(sys.version)" | |
| echo ${{ matrix.cfg.py_v_maj }}.${{ matrix.cfg.py_v_min }} | |
| if: matrix.cfg.py_v_maj!='' | |
| - run: echo "VERBOSE=1" >> $GITHUB_ENV | |
| shell: bash | |
| - run: choco install -y -r --no-progress wget | |
| shell: pwsh | |
| if: runner.os=='Windows' | |
| #- run: choco install -y -r --no-progress eigen --version=3.4.0.20240224 ${{ matrix.cfg.choco_flags }} | |
| # if: runner.os=='Windows' | |
| - run: choco install -y -r --no-progress graphviz doxygen.install & python -m pip install --upgrade pip & pip install --upgrade wheel setuptools sphinx breathe sphinx-issues sphinx-tabs sphinx_rtd_theme sphinx-reredirects furo sphinx-math-dollar sympy | |
| if: runner.os=='Windows' | |
| - run: | | |
| wget https://github.com/lebarsfa/ibex-lib/releases/download/ibex-2.8.9.20250626/ibex.2.8.9.20250626.nupkg --no-check-certificate -nv | |
| choco install -y -r --no-progress --ignore-dependencies -s . ibex --version=2.8.9.20250626 ${{ matrix.cfg.choco_flags }} --params "'/url:https://github.com/lebarsfa/ibex-lib/releases/download/ibex-2.8.9.20250626/ibex_${{ matrix.cfg.arch }}_${{ matrix.cfg.runtime }}.zip'" | |
| del /f /q ibex.2.8.9.20250626.nupkg | |
| - run: | | |
| mkdir build ; cd build | |
| cmake -E env CXXFLAGS=" /MP4 /wd4267 /wd4244 /wd4305 /wd4996" CFLAGS=" /MP4 /wd4267 /wd4244 /wd4305 /wd4996" cmake ${{ matrix.cfg.cmake_params }} -D CMAKE_INSTALL_PREFIX="../codac" -D BUILD_TESTS=ON -D WITH_CAPD=OFF -D WITH_PYTHON=ON -D PYBIND11_FINDPYTHON=OFF .. | |
| cmake --build . -j 4 --config Release --target install | |
| cmake --build . --config Release --target pip_package ; cp `ls *.whl` ../`ls *.whl | sed "s/py3-none-any/cp${{ matrix.cfg.py_v_maj }}${{ matrix.cfg.py_v_min }}-cp${{ matrix.cfg.py_v_maj }}${{ matrix.cfg.py_v_min }}${{ matrix.cfg.cpcfg }}/"` | |
| cd .. | |
| shell: bash | |
| - uses: xresloader/upload-to-github-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| file: "*.whl" | |
| overwrite: true | |
| tag_name: autotagname-${{ github.sha }} | |
| if: (github.event_name!='pull_request')&&((github.ref_name=='codac1')||(github.ref_name=='codac2')||(github.ref_name=='codac2_codac4matlab')) | |
| - run: | | |
| pip install --no-deps --no-index *.whl | |
| python -c "import sys; print(sys.version)" ; python examples/02_centered_form/main.py | |
| pip install numpy sympy --prefer-binary | |
| python -m unittest discover codac.tests | |
| cd build && ctest -C Release -V --output-on-failure | |
| cd .. | |
| shell: bash | |
| if: (github.ref_name!='codac2_codac4matlab')&&(github.event.pull_request.base.ref!='codac2_codac4matlab') |