@@ -14,12 +14,12 @@ 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
3838 if : ${{ startsWith(matrix.on, 'macos-') }}
3939 run : brew install ninja gcc cmake
4040
41- - name : " Run CMake"
41+ - name : " Install Windows packages"
42+ if : ${{ startsWith(matrix.on, 'windows-') }}
43+ shell : pwsh
44+ run : choco install cmake ninja --yes --installargs 'ADD_CMAKE_TO_PATH=System'
45+
46+ - name : " Run CMake (UNIX)"
47+ if : ${{ !startsWith(matrix.on, 'windows-') }}
4248 run : |
4349 cmake -DCMAKE_BUILD_TYPE=Release \
4450 -G Ninja \
@@ -47,11 +53,28 @@ jobs:
4753 cmake --build ../build -j $(nproc)
4854 sudo cmake --install ../build --prefix $INSTALL_PREFIX
4955
56+ - name : " Run CMake (Windows)"
57+ if : ${{ startsWith(matrix.on, 'windows-') }}
58+ shell : pwsh
59+ run : |
60+ cmake -G "Ninja" `
61+ -DCMAKE_BUILD_TYPE=Release `
62+ -DCMAKE_INSTALL_PREFIX="$install_prefix" `
63+ -DSIMDJSON_DISABLE_INSTALL=ON `
64+ -B ../build `
65+ -S $env:GITHUB_WORKSPACE
66+ cmake --build ../build --parallel
67+ cmake --install ../build
68+
5069 - name : " Install python test environment"
5170 run : python -m pip install -r ${GITHUB_WORKSPACE}/test-requirement.txt
5271
5372 - name : " Run python tests"
5473 run : |
55- export CAPIO_CL_PY_BINDING_PATH=$(realpath $INSTALL_PREFIX/lib/python/py_capio_cl*)
74+ if [[ "$RUNNER_OS" == "Windows" ]]; then
75+ export CAPIO_CL_PY_BINDING_PATH=$(cygpath -m "$INSTALL_PREFIX/lib/python/py_capio_cl*")
76+ else
77+ export CAPIO_CL_PY_BINDING_PATH=$(realpath $INSTALL_PREFIX/lib/python/py_capio_cl*)
78+ fi
5679 echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
5780 pytest ${GITHUB_WORKSPACE}/tests/python/test_*
0 commit comments