Skip to content

Commit 8e077df

Browse files
authored
Add CI build jobs for Windows (#934)
Add Windows build CI jobs for CPU build. Remaining TODO: - Add unit test #852 - Add CUDA/NVDEC extension (verified it works locally) - Add CUDA/NVDEC unit test. Part of #829
1 parent 506e609 commit 8e077df

4 files changed

Lines changed: 104 additions & 0 deletions

File tree

.github/scripts/build_windows.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
# Used by Windows CI build jobs.
4+
5+
set -x
6+
7+
curl -LsSf https://astral.sh/uv/install.sh | sh
8+
set -ex
9+
10+
py_ver="${1}"
11+
if [[ "${2}" == 'ft' ]]; then
12+
py_ver="${py_ver}t"
13+
fi
14+
15+
export PATH="${PATH}:${HOME}/.local/bin/"
16+
17+
uv python pin "${py_ver}"
18+
uv python list --only-installed
19+
uv venv
20+
uv build --no-python-downloads --all-packages --wheel
21+
mv ./dist ./package

.github/scripts/check_package.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
# Used by Windows CI build jobs.
4+
5+
pip install -r ./packaging/requirements.txt
6+
twine check --strict ./package/*.whl
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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: 0
35+
SPDL_BUILD_STUB: 0
36+
shell: cmd
37+
run: |
38+
packaging/vc_env_helper.bat ^
39+
bash ^
40+
.github/scripts/build_windows.sh ^
41+
"${{ inputs.python-version }}" ^
42+
"${{ inputs.free-threaded }}"
43+
44+
- uses: actions/upload-artifact@v4
45+
name: Upload build artifact
46+
with:
47+
name: "${{ env.ARTIFACT }}"
48+
path: package
49+
if-no-files-found: error
50+
retention-days: 7
51+
overwrite: true
52+
53+
- name: Check package
54+
shell: cmd
55+
run: |
56+
packaging/vc_env_helper.bat ^
57+
bash ^
58+
.github/scripts/check_package.sh

.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", "3.11", "3.12", "3.13"]
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: "${{ matrix.python-version == '3.11'}}"
55+
3756
#############################################################################
3857
# Linux (CPU)
3958
#############################################################################

0 commit comments

Comments
 (0)