@@ -14,18 +14,23 @@ 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+
30+ - name : " Test glob expansion"
31+ if : ${{ startsWith(matrix.on, 'windows-') }}
32+ run : dir $INSTALL_PREFIX\\C*
33+
2934 - name : " Install packages ubuntu"
3035 if : ${{ startsWith(matrix.on, 'ubuntu-') }}
3136 run : sudo apt install -y ninja-build g++
3843 if : ${{ startsWith(matrix.on, 'macos-') }}
3944 run : brew install ninja gcc cmake
4045
41- - name : " Run CMake"
46+ - name : " Install Windows packages"
47+ if : ${{ startsWith(matrix.on, 'windows-') }}
48+ shell : pwsh
49+ run : choco install cmake ninja --yes --installargs 'ADD_CMAKE_TO_PATH=System'
50+
51+ - name : " Run CMake (UNIX)"
52+ if : ${{ !startsWith(matrix.on, 'windows-') }}
4253 run : |
4354 cmake -DCMAKE_BUILD_TYPE=Release \
4455 -G Ninja \
@@ -47,11 +58,34 @@ jobs:
4758 cmake --build ../build -j $(nproc)
4859 sudo cmake --install ../build --prefix $INSTALL_PREFIX
4960
61+ - name : " Run CMake (Windows)"
62+ if : ${{ startsWith(matrix.on, 'windows-') }}
63+ shell : pwsh
64+ run : |
65+ cmake -G "Ninja" `
66+ -DCMAKE_BUILD_TYPE=Release `
67+ -DCMAKE_INSTALL_PREFIX="$install_prefix" `
68+ -B ../build `
69+ -S $env:GITHUB_WORKSPACE
70+ cmake --build ../build --parallel
71+ cmake --install ../build
72+
5073 - name : " Install python test environment"
51- run : python -m pip install -r ${GITHUB_WORKSPACE}/test-requirement.txt
74+ run : python -m pip install -r test-requirement.txt
75+
76+ - name : " Run Python tests (WINDOWS)"
77+ if : ${{ startsWith(matrix.on, 'windows-') }}
78+ shell : bash
79+ run : |
80+ PYBIND_FILE=$(ls $INSTALL_PREFIX\\lib\\python\\py_capio_cl*.pyd | head -n 1)
81+ export CAPIO_CL_PY_BINDING_PATH=$(cygpath -m "$PYBIND_FILE")
82+ echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
83+ pytest tests/python/test_*
5284
53- - name : " Run python tests"
85+ - name : " Run Python tests (UNIX)"
86+ if : ${{ !startsWith(matrix.on, 'windows-') }}
87+ shell : bash
5488 run : |
5589 export CAPIO_CL_PY_BINDING_PATH=$(realpath $INSTALL_PREFIX/lib/python/py_capio_cl*)
56- echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
90+ echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
5791 pytest ${GITHUB_WORKSPACE}/tests/python/test_*
0 commit comments