Skip to content

Commit 7a6ffab

Browse files
committed
wip: windows ci
1 parent a7e7282 commit 7a6ffab

4 files changed

Lines changed: 162 additions & 0 deletions

File tree

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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+
curl -LsSf https://astral.sh/uv/install.sh | sh
39+
set -ex
40+
41+
py_ver="${{ inputs.python-version }}"
42+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
43+
py_ver="${py_ver}t"
44+
fi
45+
46+
export PATH="${PATH}:${HOME}/.local/bin/"
47+
48+
uv python pin "${py_ver}"
49+
uv python list --only-installed
50+
uv venv
51+
uv build --no-python-downloads --all-packages --wheel
52+
mv ./dist ~/package
53+
54+
- uses: actions/upload-artifact@v4
55+
name: Upload build artifact
56+
with:
57+
name: "${{ env.ARTIFACT }}"
58+
path: ~/package
59+
if-no-files-found: error
60+
retention-days: 7
61+
overwrite: true
62+
63+
- name: Check package
64+
run: |
65+
pip install -r ./packaging/requirements.txt
66+
twine check --strict ~/package/*.whl
67+
68+
unit-test:
69+
if: "${{ inputs.run-test == 'true' }}"
70+
name: "test ffmpeg"
71+
needs: ["build"]
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
ffmpeg-version: ["4.4.2", "5.1", "6.1", "7.1"]
76+
runs-on: "${{ inputs.os }}"
77+
defaults:
78+
run:
79+
shell: bash -el {0}
80+
steps:
81+
- uses: actions/checkout@v4
82+
with:
83+
persist-credentials: false
84+
85+
- uses: actions/download-artifact@v4
86+
with:
87+
name: "${{ env.ARTIFACT }}"
88+
path: ~/package
89+
90+
- uses: conda-incubator/setup-miniconda@v3
91+
with:
92+
python-version: ${{ inputs.python-version }}
93+
conda-remove-defaults: "true"
94+
95+
- name: Unit test
96+
run: |
97+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
98+
conda install -q -c conda-forge python-freethreading
99+
fi
100+
101+
# Install SPDL
102+
pip install $(find "${HOME}/package" -name '*.whl' -depth -maxdepth 1)
103+
104+
# Install PyTorch and others
105+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
106+
pip install torch numpy pytest
107+
else
108+
pip install torch numpy numba pytest
109+
fi
110+
111+
# Install FFmpeg
112+
conda install -q -c conda-forge "ffmpeg==${{ matrix.ffmpeg-version }}"
113+
114+
pytest -v \
115+
tests/spdl_unittest/io/ \
116+
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
@@ -11,10 +11,20 @@ set(WITH_GFLAGS ON)
1111
set(WITH_GTEST OFF)
1212
set(gflags_NAMESPACE gflags)
1313

14+
if (WIN32)
1415
FetchContent_Declare(
1516
glog
1617
URL https://github.com/google/glog/archive/refs/tags/v0.5.0.tar.gz
1718
URL_HASH SHA256=eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5
1819
DOWNLOAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
20+
PATCH_COMMAND pwd && ls -lh && patch -p1 < "${CMAKE_CURRENT_SOURCE_DIR}/patch.diff"
1921
)
22+
else()
23+
FetchContent_Declare(
24+
glog
25+
URL https://github.com/google/glog/archive/refs/tags/v0.5.0.tar.gz
26+
URL_HASH SHA256=eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5
27+
DOWNLOAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
28+
)
29+
endif()
2030
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)