Skip to content

Commit 14f8c18

Browse files
committed
wip: windows ci
1 parent fe5d6ca commit 14f8c18

4 files changed

Lines changed: 165 additions & 0 deletions

File tree

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: " - Wheel (Windows)"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
free-threaded:
10+
description: 'Whether FT Python or not. Valid value is "ft" or not.'
11+
default: ''
12+
type: string
13+
run-test:
14+
required: false
15+
default: 'false'
16+
type: string
17+
os:
18+
default: "windows-latest"
19+
type: string
20+
21+
env:
22+
ARTIFACT: wheel-win-py${{ inputs.python-version }}${{ inputs.free-threaded }}
23+
24+
jobs:
25+
build:
26+
runs-on: "${{ inputs.os }}"
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
persist-credentials: false
31+
32+
- name: Build
33+
env:
34+
SPDL_USE_TRACING: 1
35+
SPDL_BUILD_STUB: 1
36+
shell: bash
37+
run: |
38+
# choco does not have a zlib
39+
# choco install zlib -y
40+
41+
curl -LsSf https://astral.sh/uv/install.sh | sh
42+
set -ex
43+
44+
py_ver="${{ inputs.python-version }}"
45+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
46+
py_ver="${py_ver}t"
47+
fi
48+
49+
export PATH="${PATH}:${HOME}/.local/bin/"
50+
51+
uv python pin "${py_ver}"
52+
uv python list --only-installed
53+
uv venv
54+
uv build --no-python-downloads --all-packages --wheel
55+
mv ./dist ~/package
56+
57+
- uses: actions/upload-artifact@v4
58+
name: Upload build artifact
59+
with:
60+
name: "${{ env.ARTIFACT }}"
61+
path: ~/package
62+
if-no-files-found: error
63+
retention-days: 7
64+
overwrite: true
65+
66+
- name: Check package
67+
run: |
68+
pip install -r ./packaging/requirements.txt
69+
twine check --strict ~/package/*.whl
70+
71+
unit-test:
72+
if: "${{ inputs.run-test == 'true' }}"
73+
name: "test ffmpeg"
74+
needs: ["build"]
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
ffmpeg-version: ["4.4.2", "5.1", "6.1", "7.1"]
79+
runs-on: "${{ inputs.os }}"
80+
defaults:
81+
run:
82+
shell: bash -el {0}
83+
steps:
84+
- uses: actions/checkout@v4
85+
with:
86+
persist-credentials: false
87+
88+
- uses: actions/download-artifact@v4
89+
with:
90+
name: "${{ env.ARTIFACT }}"
91+
path: ~/package
92+
93+
- uses: conda-incubator/setup-miniconda@v3
94+
with:
95+
python-version: ${{ inputs.python-version }}
96+
conda-remove-defaults: "true"
97+
98+
- name: Unit test
99+
run: |
100+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
101+
conda install -q -c conda-forge python-freethreading
102+
fi
103+
104+
# Install SPDL
105+
pip install $(find "${HOME}/package" -name '*.whl' -depth -maxdepth 1)
106+
107+
# Install PyTorch and others
108+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
109+
pip install torch numpy pytest
110+
else
111+
pip install torch numpy numba pytest
112+
fi
113+
114+
# Install FFmpeg
115+
conda install -q -c conda-forge "ffmpeg==${{ matrix.ffmpeg-version }}"
116+
117+
pytest -v \
118+
tests/spdl_unittest/io/ \
119+
tests/spdl_unittest/dataloader/

.github/workflows/packaging.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ jobs:
3434
# free-threaded: "${{ matrix.free-threaded }}"
3535
# run-test: "false"
3636

37+
#############################################################################
38+
# Windows
39+
#############################################################################
40+
windows:
41+
name: "Windows"
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
python-version: ["3.10"]
46+
free-threaded: [""]
47+
include:
48+
- python-version: "3.13"
49+
free-threaded: "ft"
50+
uses: ./.github/workflows/_build_windows.yml
51+
with:
52+
python-version: "${{ matrix.python-version }}"
53+
free-threaded: "${{ matrix.free-threaded }}"
54+
run-test: "true"
55+
3756
#############################################################################
3857
# Linux (CPU)
3958
#############################################################################

src/third_party/glog/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ set(BUILD_SHARED_LIBS OFF)
66
set(WITH_GFLAGS OFF)
77
set(WITH_GTEST OFF)
88

9+
if (WIN32)
10+
FetchContent_Declare(
11+
glog
12+
URL https://github.com/google/glog/archive/refs/tags/v0.5.0.tar.gz
13+
URL_HASH SHA256=eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5
14+
DOWNLOAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
15+
PATCH_COMMAND pwd && ls -lh && patch -p1 < "${CMAKE_CURRENT_SOURCE_DIR}/patch.diff"
16+
)
17+
else()
918
FetchContent_Declare(
1019
glog
1120
URL https://github.com/google/glog/archive/refs/tags/v0.6.0.tar.gz
1221
URL_HASH SHA256=8a83bf982f37bb70825df71a9709fa90ea9f4447fb3c099e1d720a439d88bad6
1322
DOWNLOAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
1423
)
24+
endif()
1525
FetchContent_MakeAvailable(glog)

src/third_party/glog/patch.diff

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--- /CMakeLists.txt 2025-08-12 13:13:39
2+
+++ /CMakeLists.txt 2025-08-12 13:14:16
3+
@@ -523,12 +523,12 @@
4+
list (APPEND GLOG_SRCS src/signalhandler.cc)
5+
endif (HAVE_PTHREAD OR WIN32)
6+
7+
-if (WIN32)
8+
+if ((CYGWIN OR WIN32) AND NOT (UNIX OR MINGW))
9+
list (APPEND GLOG_SRCS
10+
src/windows/port.cc
11+
src/windows/port.h
12+
)
13+
-endif (WIN32)
14+
+endif ((CYGWIN OR WIN32) AND NOT (UNIX OR MINGW))
15+
16+
add_compile_options ($<$<AND:$<BOOL:${HAVE_NO_UNNAMED_TYPE_TEMPLATE_ARGS}>,$<NOT:$<CXX_COMPILER_ID:GNU>>>:-Wno-unnamed-type-template-args>)
17+

0 commit comments

Comments
 (0)