Skip to content

Commit a20b6fc

Browse files
committed
Added windows workflow
1 parent 6b94661 commit a20b6fc

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

.github/workflows/python-bindings.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -38,7 +38,13 @@ jobs:
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_*

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ FetchContent_Declare(
4949
GIT_TAG v3.0.1
5050
)
5151

52+
set(SIMDJSON_BUILD_STATIC ON CACHE BOOL "" FORCE)
53+
set(SIMDJSON_ENABLE_INSTALL OFF CACHE BOOL "" FORCE)
5254
set(SIMDJSON_IMPLEMENTATION fallback CACHE STRING "" FORCE)
5355
FetchContent_MakeAvailable(simdjson pybind11)
5456

0 commit comments

Comments
 (0)