Skip to content

Commit bed476e

Browse files
committed
wip: windows ci
1 parent 4b3a006 commit bed476e

2 files changed

Lines changed: 132 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)