-
Notifications
You must be signed in to change notification settings - Fork 28
140 lines (123 loc) · 4.06 KB
/
Copy path_build_windows.yml
File metadata and controls
140 lines (123 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: " - Wheel (Windows)"
on:
workflow_call:
inputs:
python-version:
required: true
type: string
free-threaded:
description: 'Whether FT Python or not. Valid value is "ft" or not.'
default: ''
type: string
use-nvdec:
default: "nvdec"
type: string
description: 'Whether build NVDEC extension. Valid value is "nvdec" or not.'
run-test:
required: false
default: 'false'
type: string
machine:
default: "windows-latest"
type: string
test-concurrency:
required: false
default: '3'
type: string
cuda-version:
required: true
type: string
# valida values are like 12.4.1, 12.3.1 etc...
env:
ARTIFACT: wheel-win-py${{ inputs.python-version }}${{ inputs.free-threaded }}
SPDL_USE_TRACING: 0
SPDL_USE_CUDA: 1
SPDL_USE_NVCODEC: "${{ inputs.use-nvdec == 'nvdec' }}"
jobs:
build:
runs-on: "${{ inputs.machine }}"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/cache/restore@v4
with:
path: src/third_party/cache
key: "cmake-build-dependencies-${{ hashFiles('src/third_party/**/CMakeLists.txt') }}"
- name: Build
run: |
.\packaging\vc_env_helper.bat `
bash `
.github/scripts/windows/build_package.sh `
"${{ inputs.python-version }}" `
'"${{ inputs.free-threaded }}"' `
"${{ inputs.cuda-version }}"
# note the `inputs.free-threaded` can be empty so that the most outer
# single bracket is necessary
- uses: actions/upload-artifact@v4
name: Upload build artifact
with:
name: "${{ env.ARTIFACT }}"
path: package
if-no-files-found: error
retention-days: 7
overwrite: true
- name: Check package
run: |
.\packaging\vc_env_helper.bat `
bash `
.github/scripts/windows/check_package.sh
- uses: actions/cache/save@v4
with:
path: src/third_party/cache
key: "cmake-build-dependencies-${{ hashFiles('src/third_party/**/CMakeLists.txt') }}"
unit-test:
if: "${{ inputs.run-test == 'true' }}"
name: "test (py ${{ inputs.python-version }}, ffmpeg ${{ matrix.ffmpeg-version }})"
needs: ["build"]
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["8.0"]
runs-on: "${{ inputs.machine }}"
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/download-artifact@v4
with:
name: "${{ env.ARTIFACT }}"
path: package
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ inputs.python-version }}
channels: conda-forge
conda-remove-defaults: "true"
- name: Setup
run: |
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
conda install -q python-freethreading
fi
conda install -q pip
# Install SPDL
python -m pip install $(find package -name '*.whl' -depth -maxdepth 1)
spdl --help
# Install PyTorch and others
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
python -m pip install torch numpy pytest pytest-xdist parameterized matplotlib
else
python -m pip install torch numpy numba pytest pytest-xdist parameterized matplotlib
fi
# Install FFmpeg
conda install -q "ffmpeg==${{ matrix.ffmpeg-version }}"
- name: Unit test
run: |
set -ex
pytest -v -n ${{ inputs.test-concurrency }} \
tests/io/core \
tests/dataloader \
tests/pipeline \
tests/autoresearch