-
Notifications
You must be signed in to change notification settings - Fork 438
201 lines (183 loc) · 5.79 KB
/
Copy pathsmoke.yml
File metadata and controls
201 lines (183 loc) · 5.79 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: smoke
on:
workflow_dispatch:
push:
branches: main
paths-ignore:
- '**.md'
- '**.rst'
- '**.txt'
- '.github/workflows/tests.yml'
pull_request:
branches: main
paths-ignore:
- '**.md'
- '**.rst'
- '**.txt'
- '.github/workflows/tests.yml'
jobs:
style:
runs-on: ubuntu-slim
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Linters
run: make lint
nix:
name: "py-${{ matrix.config.python }} lib-${{ matrix.config.ffmpeg }} ${{matrix.config.os}}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-24.04, python: "3.14", ffmpeg: "8.1.2", extras: true}
- {os: ubuntu-24.04, python: "3.11", ffmpeg: "8.0.3"}
- {os: ubuntu-24.04, python: "3.13", ffmpeg: "8.1.2"}
- {os: macos-14, python: "3.12", ffmpeg: "8.0.3"}
- {os: macos-14, python: "3.14", ffmpeg: "8.1.2"}
env:
PYAV_PYTHON: python${{ matrix.config.python }}
PYAV_LIBRARY: ffmpeg-${{ matrix.config.ffmpeg }}
steps:
- uses: actions/checkout@v7
name: Checkout
- name: Python ${{ matrix.config.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.config.python }}
allow-prereleases: true
- name: OS Packages
run: |
case ${{ matrix.config.os }} in
ubuntu-24.04)
sudo apt-get update
sudo apt-get install \
autoconf \
automake \
build-essential \
cmake \
libtool \
libx264-dev \
nasm \
pkg-config \
zlib1g-dev
if [[ "${{ matrix.config.extras }}" ]]; then
sudo apt-get install doxygen
fi
;;
macos-14)
brew install automake libtool opus x264
;;
esac
- name: Pip and FFmpeg
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
scripts/build-deps
- name: Build
run: |
[ "${{ runner.os }}" = "macOS" ] && export ARCHFLAGS="-arch $(uname -m)"
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
scripts/build
- name: Test
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
python -m av --version # Assert it can import.
make test
- name: Docs
if: matrix.config.extras
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
make -C docs html
- name: Doctest
if: matrix.config.extras
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
make -C docs test
- name: Examples
if: matrix.config.extras
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
scripts/test examples
windows:
name: "py-${{ matrix.config.python }} lib-${{ matrix.config.ffmpeg }} ${{matrix.config.os}}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, python: "3.11", ffmpeg: "latest"}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Conda
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda config --set always_yes true
conda config --add channels conda-forge
conda config --add channels scientific-python-nightly-wheels
conda create -q -n pyav \
numpy \
pillow \
pytest \
python=${{ matrix.config.python }} \
setuptools \
cython
- name: Build
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate pyav
python scripts\\fetch-vendor.py --config-file scripts\\ffmpeg-${{ matrix.config.ffmpeg }}.json $CONDA_PREFIX\\Library
python setup.py build_ext --inplace --ffmpeg-dir=$CONDA_PREFIX\\Library
- name: Test
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate pyav
python -m pytest
armv7:
name: "armv7 cross-build + qemu smoke"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Set up host Python 3.11
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Set up host Python 3.14t
uses: actions/setup-python@v6
with:
python-version: "3.14t"
- name: Install build tooling
run: |
for py in python3.11 python3.14t; do
$py -m pip install -U "cython>=3.1.0,<4" "setuptools>=77.0" wheel
done
# patchelf 0.18 (ubuntu-24.04's system version) corrupts ELF files
# with large p_align; pin <0.18 for auditwheel to use.
python3.11 -m pip install -U ziglang auditwheel 'patchelf<0.18'
- name: Cross-compile armv7l wheels with zig
env:
HOST_PY311: python3.11
HOST_PY314T: python3.14t
TOOLS_PY: python3.11
run: bash scripts/build-armv7l-cross.sh
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: arm
- name: Import-test wheels under emulation
run: |
docker run --rm --platform linux/arm/v7 -v "$PWD/dist:/dist:ro" \
quay.io/pypa/manylinux_2_31_armv7l bash -ceu '
for py in /opt/python/cp311-cp311 /opt/python/cp314-cp314t; do
echo "::group::$("$py/bin/python" --version)"
"$py/bin/pip" install --no-index --find-links /dist av
"$py/bin/python" -m av --version
echo "::endgroup::"
done'