-
Notifications
You must be signed in to change notification settings - Fork 28
134 lines (115 loc) · 3.58 KB
/
Copy path_build_macos.yml
File metadata and controls
134 lines (115 loc) · 3.58 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
name: " - Wheel (macOS)"
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
run-test:
required: false
default: 'false'
type: string
machine:
default: "macos-latest"
type: string
test-concurrency:
required: false
default: '3'
type: string
env:
ARTIFACT: wheel-macos-py${{ inputs.python-version }}${{ inputs.free-threaded }}
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
env:
SPDL_USE_TRACING: 1
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
set -ex
py_ver="${{ inputs.python-version }}"
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
py_ver="${py_ver}t"
fi
uv python pin "${py_ver}"
uv python list --only-installed
uv venv
uv build --no-python-downloads --all-packages --wheel
mv ./dist ~/package
- 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: |
pip install -r ./packaging/requirements.txt
twine check --strict ~/package/*.whl
- 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 (ffmpeg ${{ matrix.ffmpeg-version }})"
needs: ["build"]
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["4.4.2", "5.1", "6.1", "7.1"]
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 }}
conda-remove-defaults: "true"
- name: Setup
run: |
set -ex
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
conda install -q -c conda-forge python-freethreading
fi
# Install SPDL
pip install $(find "${HOME}/package" -name '*.whl' -depth -maxdepth 1)
spdl --help
# Install PyTorch and others
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
pip install torch numpy pytest parameterized matplotlib
else
pip install torch numpy numba pytest parameterized matplotlib
fi
# Install FFmpeg
conda install -q -c conda-forge "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