@@ -14,18 +14,19 @@ jobs:
1414 name : " Test python bindings"
1515 strategy :
1616 matrix :
17- on : [ 'ubuntu-24.04', 'macos-15-intel' , 'macos-26' ]
17+ on : [ 'ubuntu-24.04', 'macos-15-intel', 'macos-26', 'windows-2022', 'windows-2025 ' ]
1818 python : [ '3.10', '3.11', '3.12', '3.13' ]
1919
2020 runs-on : ${{matrix.on}}
2121 env :
22- INSTALL_PREFIX : " /usr/local"
22+ INSTALL_PREFIX : ${{ startsWith(matrix.on, 'windows-') && format('{0}\install', github.workspace) || ' /usr/local' }}
2323
2424 steps :
2525 - uses : actions/checkout@v4
2626 - uses : actions/setup-python@v6
2727 with :
2828 python-version : ${{matrix.python}}
29+
2930 - name : " Install packages ubuntu"
3031 if : ${{ startsWith(matrix.on, 'ubuntu-') }}
3132 run : sudo apt install -y ninja-build g++
3839 if : ${{ startsWith(matrix.on, 'macos-') }}
3940 run : brew install ninja gcc cmake
4041
41- - name : " Run CMake"
42+ - name : " Install Windows packages"
43+ if : ${{ startsWith(matrix.on, 'windows-') }}
44+ shell : pwsh
45+ run : choco install cmake ninja --yes --installargs 'ADD_CMAKE_TO_PATH=System'
46+
47+ - name : " Run CMake (UNIX)"
48+ if : ${{ !startsWith(matrix.on, 'windows-') }}
4249 run : |
4350 cmake -DCMAKE_BUILD_TYPE=Release \
4451 -G Ninja \
@@ -47,11 +54,33 @@ jobs:
4754 cmake --build ../build -j $(nproc)
4855 sudo cmake --install ../build --prefix $INSTALL_PREFIX
4956
57+ - name : " Run CMake (Windows)"
58+ if : ${{ startsWith(matrix.on, 'windows-') }}
59+ shell : pwsh
60+ run : |
61+ cmake -G "Ninja" `
62+ -DCMAKE_BUILD_TYPE=Release `
63+ -B ../build `
64+ -S $env:GITHUB_WORKSPACE
65+ cmake --build ../build --parallel
66+ cmake --install ../build --prefix $env:INSTALL_PREFIX
67+
5068 - name : " Install python test environment"
51- run : python -m pip install -r ${GITHUB_WORKSPACE}/test-requirement.txt
69+ run : python -m pip install -r test-requirement.txt
70+
71+ - name : " Run Python tests (WINDOWS)"
72+ if : ${{ startsWith(matrix.on, 'windows-') }}
73+ shell : bash
74+ run : |
75+ PYBIND_FILE=$INSTALL_PREFIX\\lib\\python\\$(dir $INSTALL_PREFIX\\lib\\python | head -n 1)
76+ export CAPIO_CL_PY_BINDING_PATH=$(cygpath -m "$PYBIND_FILE")
77+ echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
78+ pytest tests/python/test_*
5279
53- - name : " Run python tests"
80+ - name : " Run Python tests (UNIX)"
81+ if : ${{ !startsWith(matrix.on, 'windows-') }}
82+ shell : bash
5483 run : |
5584 export CAPIO_CL_PY_BINDING_PATH=$(realpath $INSTALL_PREFIX/lib/python/py_capio_cl*)
56- echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
85+ echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
5786 pytest ${GITHUB_WORKSPACE}/tests/python/test_*
0 commit comments