@@ -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,34 @@ 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+ -DCMAKE_INSTALL_PREFIX="$install_prefix" `
64+ -B ../build `
65+ -S $env:GITHUB_WORKSPACE
66+ cmake --build ../build --parallel
67+ cmake --install ../build
68+
5069 - name : " Install python test environment"
51- run : python -m pip install -r ${GITHUB_WORKSPACE}/test-requirement.txt
70+ run : python -m pip install -r test-requirement.txt
71+
72+ - name : " Run Python tests (WINDOWS)"
73+ if : ${{ startsWith(matrix.on, 'windows-') }}
74+ shell : bash
75+ run : |
76+ PYBIND_FILE=$(ls $INSTALL_PREFIX\\lib\\python\\py_capio_cl*.pyd | head -n 1)
77+ export CAPIO_CL_PY_BINDING_PATH=$(cygpath -m "$PYBIND_FILE")
78+ echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
79+ pytest tests/python/test_*
5280
53- - name : " Run python tests"
81+ - name : " Run Python tests (UNIX)"
82+ if : ${{ !startsWith(matrix.on, 'windows-') }}
83+ shell : bash
5484 run : |
5585 export CAPIO_CL_PY_BINDING_PATH=$(realpath $INSTALL_PREFIX/lib/python/py_capio_cl*)
56- echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
86+ echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
5787 pytest ${GITHUB_WORKSPACE}/tests/python/test_*
0 commit comments