Repository navigation
604 lines (548 loc) · 22 KB
/
Copy pathci.yml
File metadata and controls
604 lines (548 loc) · 22 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
name: ci
on:
push:
branches: [ "main", "master" ]
paths-ignore:
- 'README.md'
pull_request:
branches: [ "main", "master" ]
paths-ignore:
- 'README.md'
env:
CARGO_TERM_COLOR: "always"
CARGO_INCREMENTAL: "0"
RUST_BACKTRACE: "1"
RUST_LOG: "DEBUG"
RUSTFLAGS: "-D warnings"
CARGO_BUILD_JOBS: "2"
CARGO_NET_RETRY: "10"
jobs:
lints:
name: Rust fmt / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt
- name: Rust fmt
run: cargo fmt --all -- --check
clippy:
name: clippy / ${{ matrix.arch }} / ffmpeg-${{ matrix.ffmpeg_version }}
runs-on: ${{ matrix.runner }}
container:
# jrottenberg/ffmpeg 8.0 开始有 amd64 + arm64,8.0 之前只有 amd64
image: jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu2404
options: --pull always
env:
FFMPEG_INCLUDE_DIR: /usr/local/include
FFMPEG_PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
strategy:
fail-fast: false
matrix:
include:
- arch: linux/amd64
runner: ubuntu-latest
ffmpeg_version: "6.1"
feature: "ndarray,ffmpeg6,link_system_ffmpeg"
- arch: linux/amd64
runner: ubuntu-latest
ffmpeg_version: "7.1"
feature: "ndarray,ffmpeg7,link_system_ffmpeg"
- arch: linux/amd64
runner: ubuntu-latest
ffmpeg_version: "8.1"
feature: "ndarray,ffmpeg8,link_system_ffmpeg"
- arch: linux/amd64
runner: ubuntu-latest
ffmpeg_version: "9.0"
feature: "ndarray,ffmpeg9,link_system_ffmpeg"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
nasm \
yasm \
curl \
wget \
unzip \
gnupg \
clang \
cmake \
libtool \
autoconf \
automake \
binutils \
xz-utils \
pkg-config \
llvm-dev \
libc++1 \
libva2 \
libva-drm2 \
libva-x11-2 \
libvdpau1 \
libxv1 \
libclang-dev \
linux-libc-dev \
build-essential \
ca-certificates \
libva-dev \
libvpx-dev \
libaom-dev \
libass-dev \
libdrm-dev \
libv4l-dev \
libx264-dev \
libx264-164 \
libx265-dev \
libx265-199 \
libzimg-dev \
libdav1d-dev \
libwebp-dev \
libbluray-dev \
libtheora-dev \
libvidstab-dev \
libsvtav1-dev \
libxvidcore-dev \
libopenjp2-7-dev \
libgsm1-dev \
libsoxr-dev \
libopus-dev \
libpulse-dev \
libshine-dev \
libspeex-dev \
libbs2b-dev \
libvorbis-dev \
libfdk-aac-dev \
libasound2-dev \
libmp3lame-dev \
libmp3lame0 \
libtwolame-dev \
libjack-jackd2-dev \
libopencore-amrnb-dev \
libopencore-amrwb-dev \
libva-dev \
libdrm-dev \
libnuma-dev \
libvdpau-dev \
ocl-icd-opencl-dev \
libass-dev \
libxml2-dev \
libfribidi-dev \
libfreetype6-dev \
libfontconfig1-dev \
libssh-dev \
libzmq5-dev \
libssl-dev \
librtmp-dev \
libiec61883-dev \
libgnutls28-dev \
libsmbclient-dev \
libtiff-dev \
libpng-dev \
libraw-dev \
libjpeg-dev \
zlib1g-dev \
libsdl2-dev \
liblzma-dev \
libzvbi-dev \
libpostproc-dev \
librubberband-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt, clippy, rust-src, llvm-tools-preview, rust-analysis
- name: Verify FFmpeg version
run: |
ldconfig
ffmpeg -version
- name: Check
run: cargo check --workspace --all-targets --no-default-features --features ${{ matrix.feature }}
- name: Clippy
run: cargo clippy --workspace --all-targets --no-default-features --features ${{ matrix.feature }} -- -D warnings
- name: Doc Test
run: cargo test --doc --workspace --no-default-features --features ${{ matrix.feature }} --verbose
test-macos:
name: test / ${{ matrix.platform }} / ffmpeg-${{ matrix.ffmpeg_version }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
platform: ["macos/arm64"]
ffmpeg_version: ["6", "7", "8", "9"]
include:
- ffmpeg_version: "6"
feature: "ndarray,ffmpeg6,link_system_ffmpeg"
brew_formula: "ffmpeg@6"
- ffmpeg_version: "7"
feature: "ndarray,ffmpeg7,link_system_ffmpeg"
brew_formula: "ffmpeg@7"
- ffmpeg_version: "8"
feature: "ndarray,ffmpeg8,link_system_ffmpeg"
brew_formula: "ffmpeg@8"
- ffmpeg_version: "9"
feature: "ndarray,ffmpeg9,link_system_ffmpeg"
brew_formula: "ffmpeg"
env:
FFMPEG_PKG_CONFIG_PATH: /opt/homebrew/opt/${{ matrix.brew_formula }}/lib/pkgconfig
FFMPEG_INCLUDE_DIR: /opt/homebrew/opt/${{ matrix.brew_formula }}/include
CPPFLAGS: "-I/opt/homebrew/opt/${{ matrix.brew_formula }}/include"
LDFLAGS: "-L/opt/homebrew/opt/${{ matrix.brew_formula }}/lib"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt, clippy
- name: Cache Cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
run: brew update && brew install pkg-config ${{ matrix.brew_formula }}
- name: Check
run: cargo check --workspace --all-targets --no-default-features --features ${{ matrix.feature }}
- name: Clippy
run: cargo clippy --workspace --all-targets --no-default-features --features ${{ matrix.feature }} -- -D warnings
- name: Run Test
run: cargo test --workspace --all-targets --no-default-features --features ${{ matrix.feature }} --verbose
test-linux:
name: test / ${{ matrix.arch }} / ffmpeg-${{ matrix.ffmpeg_version }}
runs-on: ${{ matrix.runner }}
# https://github.com/BtbN/FFmpeg-Builds/releases provides Windows (x86_64, arm64) + Linux (x86_64, arm64)
# https://github.com/GyanD/codexffmpeg/releases provides Windows x86_64
strategy:
fail-fast: false
matrix:
include:
- arch: linux/amd64
runner: ubuntu-latest
ffmpeg_version: "6.1"
feature: "ndarray,ffmpeg6,link_system_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-08-31-13-00/ffmpeg-n6.1.3-linux64-gpl-shared-6.1.tar.xz"
- arch: linux/arm64
runner: ubuntu-24.04-arm
ffmpeg_version: "6.1"
feature: "ndarray,ffmpeg6,link_system_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-08-31-13-00/ffmpeg-n6.1.3-linuxarm64-gpl-shared-6.1.tar.xz"
- arch: linux/amd64
runner: ubuntu-latest
ffmpeg_version: "7.1"
feature: "ndarray,ffmpeg7,link_system_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-07-31-14-10/ffmpeg-n7.1.5-12-g1fdbca85aa-linux64-gpl-shared-7.1.tar.xz"
- arch: linux/arm64
runner: ubuntu-24.04-arm
ffmpeg_version: "7.1"
feature: "ndarray,ffmpeg7,link_system_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-07-31-14-10/ffmpeg-n7.1.5-12-g1fdbca85aa-linuxarm64-gpl-shared-7.1.tar.xz"
- arch: linux/amd64
runner: ubuntu-latest
ffmpeg_version: "8.1"
feature: "ndarray,ffmpeg8,link_system_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n8.1-latest-linux64-gpl-shared-8.1.tar.xz"
- arch: linux/arm64
runner: ubuntu-24.04-arm
ffmpeg_version: "8.1"
feature: "ndarray,ffmpeg8,link_system_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n8.1-latest-linuxarm64-gpl-shared-8.1.tar.xz"
- arch: linux/amd64
runner: ubuntu-latest
ffmpeg_version: "9.0"
feature: "ndarray,ffmpeg9,link_system_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n9.0-latest-linux64-gpl-shared-9.0.tar.xz"
- arch: linux/arm64
runner: ubuntu-24.04-arm
ffmpeg_version: "9.0"
feature: "ndarray,ffmpeg9,link_system_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n9.0-latest-linuxarm64-gpl-shared-9.0.tar.xz"
env:
FFMPEG_DIR: /opt/ffmpeg
FFMPEG_INCLUDE_DIR: /opt/ffmpeg/include
FFMPEG_LIBS_DIR: /opt/ffmpeg/lib
FFMPEG_PKG_CONFIG_PATH: /opt/ffmpeg/lib/pkgconfig
PKG_CONFIG_PATH: /opt/ffmpeg/lib/pkgconfig
LD_LIBRARY_PATH: /opt/ffmpeg/lib
steps:
- name: Checkout
uses: actions/checkout@v6
# apt-get purge -y libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev libavdevice-dev
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
nasm \
yasm \
curl \
wget \
unzip \
gnupg \
clang \
cmake \
libtool \
autoconf \
automake \
binutils \
xz-utils \
pkg-config \
llvm-dev \
libc++1 \
libva2 \
libva-drm2 \
libva-x11-2 \
libvdpau1 \
libxv1 \
libclang-dev \
linux-libc-dev \
build-essential \
ca-certificates \
libva-dev \
libvpx-dev \
libaom-dev \
libass-dev \
libdrm-dev \
libv4l-dev \
libx264-dev \
libx264-164 \
libx265-dev \
libx265-199 \
libzimg-dev \
libdav1d-dev \
libwebp-dev \
libbluray-dev \
libtheora-dev \
libvidstab-dev \
libsvtav1-dev \
libxvidcore-dev \
libopenjp2-7-dev \
libgsm1-dev \
libsoxr-dev \
libopus-dev \
libpulse-dev \
libshine-dev \
libspeex-dev \
libbs2b-dev \
libvorbis-dev \
libfdk-aac-dev \
libasound2-dev \
libmp3lame-dev \
libmp3lame0 \
libtwolame-dev \
libjack-jackd2-dev \
libopencore-amrnb-dev \
libopencore-amrwb-dev \
libnuma-dev \
libvdpau-dev \
ocl-icd-opencl-dev \
libxml2-dev \
libfribidi-dev \
libfreetype6-dev \
libfontconfig1-dev \
libssh-dev \
libzmq5-dev \
libssl-dev \
librtmp-dev \
libiec61883-dev \
libgnutls28-dev \
libsmbclient-dev \
libtiff-dev \
libpng-dev \
libraw-dev \
libjpeg-dev \
zlib1g-dev \
libsdl2-dev \
liblzma-dev \
libzvbi-dev \
libpostproc-dev \
librubberband-dev
- name: Install BtbN FFmpeg
run: |
sudo rm -rf "${FFMPEG_DIR}"
sudo mkdir -p "${FFMPEG_DIR}"
wget --retry-connrefused --tries=5 --waitretry=3 \
-O ffmpeg.tar.xz \
"${{ matrix.download_url }}"
sudo tar -xJf ffmpeg.tar.xz \
-C "${FFMPEG_DIR}" \
--strip-components=1
sudo ldconfig
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt, clippy, rust-src, llvm-tools-preview, rust-analysis
- name: Verify FFmpeg version
run: |
echo "FFMPEG_DIR=${FFMPEG_DIR}"
echo "FFMPEG_INCLUDE_DIR=${FFMPEG_INCLUDE_DIR}"
echo "FFMPEG_LIBS_DIR=${FFMPEG_LIBS_DIR}"
echo "FFMPEG_PKG_CONFIG_PATH=${FFMPEG_PKG_CONFIG_PATH}"
/opt/ffmpeg/bin/ffmpeg -version
pkg-config --modversion libavutil
pkg-config --modversion libavcodec
pkg-config --modversion libavformat
# The hosted runner image preinstalls a system FFmpeg whose shared/static libraries can be
# scattered under /usr in any multi-arch directory (not guaranteed to be /usr/lib/x86_64-linux-gnu).
# If those are linked into the test binary alongside the downloaded BtbN FFmpeg (different
# sonames), an AVFrame allocated by one libavutil may be freed by another, corrupting the heap
# (SIGABRT). Here we explicitly echo the located libs, delete all system FFmpeg library files,
# and purge the packages to guarantee the tests only use the single /opt/ffmpeg copy.
- name: Remove system FFmpeg dev libraries
run: |
set -euo pipefail
echo "==== Before cleanup: system-visible FFmpeg shared libs ===="
ldconfig -p | grep -Ei 'libav(codec|device|format|util|filter)|libsw(scale|resample)' || echo "(none)"
echo "==== Locating system FFmpeg library files (excluding /opt/ffmpeg, /proc, /sys, /dev) ===="
sudo find / \( -path /opt/ffmpeg -o -path /proc -o -path /sys -o -path /dev \) -prune -o \
-type f \( -name 'libav*.so*' -o -name 'libav*.a' \
-o -name 'libsw*.so*' -o -name 'libsw*.a' \) -print 2>/dev/null \
| tee /tmp/sys_ffmpeg_libs.txt
if [ -s /tmp/sys_ffmpeg_libs.txt ]; then
echo "--- Deleting the listed library files ---"
while IFS= read -r f; do echo "rm $f"; sudo rm -f "$f"; done < /tmp/sys_ffmpeg_libs.txt
else
echo "(no system FFmpeg library files found)"
fi
# Purge system FFmpeg packages (dev / runtime / ffmpeg itself) to clear package-level leftovers
sudo apt-get purge -y \
libavcodec-dev \
libavformat-dev \
libavfilter-dev \
libavdevice-dev \
libavutil-dev \
libswscale-dev \
libswresample-dev \
libavcodec* \
libavformat* \
libavutil* \
libswscale* \
libswresample* \
libavfilter* \
libavdevice* ffmpeg 2>/dev/null || true
sudo ldconfig
echo "==== Post-cleanup check: no FFmpeg should remain in the system cache ===="
if ldconfig -p | grep -Eiq 'libav(codec|device|format|util|filter)|libsw(scale|resample)'; then
echo "!! WARNING: entries still present:"
ldconfig -p | grep -Ei 'libav(codec|device|format|util|filter)|libsw(scale|resample)'
exit 1
else
echo "OK: no FFmpeg in system link/runtime cache"
fi
- name: Check
run: cargo check --workspace --all-targets --no-default-features --features ${{ matrix.feature }}
- name: Clippy
run: cargo clippy --workspace --all-targets --no-default-features --features ${{ matrix.feature }} -- -D warnings
- name: Run Test
run: cargo test --workspace --all-targets --no-default-features --features ${{ matrix.feature }} --verbose
test-windows:
name: test / ${{ matrix.arch }} / ffmpeg-${{ matrix.ffmpeg_version }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: windows/amd64
runner: windows-latest
ffmpeg_version: "6.1"
feature: "ndarray,ffmpeg6,link_vcpkg_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-08-31-13-00/ffmpeg-n6.1.3-win64-gpl-shared-6.1.zip"
- arch: windows/arm64
runner: windows-11-arm
ffmpeg_version: "6.1"
feature: "ndarray,ffmpeg6,link_vcpkg_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-08-31-13-00/ffmpeg-n6.1.3-winarm64-gpl-shared-6.1.zip"
- arch: windows/amd64
runner: windows-latest
ffmpeg_version: "7.1"
feature: "ndarray,ffmpeg7,link_vcpkg_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-07-31-14-10/ffmpeg-n7.1.5-12-g1fdbca85aa-win64-gpl-shared-7.1.zip"
- arch: windows/arm64
runner: windows-11-arm
ffmpeg_version: "7.1"
feature: "ndarray,ffmpeg7,link_vcpkg_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-07-31-14-10/ffmpeg-n7.1.5-12-g1fdbca85aa-winarm64-gpl-shared-7.1.zip"
- arch: windows/amd64
runner: windows-latest
ffmpeg_version: "8.1"
feature: "ndarray,ffmpeg8,link_vcpkg_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n8.1-latest-win64-gpl-shared-8.1.zip"
- arch: windows/arm64
runner: windows-11-arm
ffmpeg_version: "8.1"
feature: "ndarray,ffmpeg8,link_vcpkg_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n8.1-latest-winarm64-gpl-shared-8.1.zip"
- arch: windows/amd64
runner: windows-latest
ffmpeg_version: "9.0"
feature: "ndarray,ffmpeg9,link_vcpkg_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n9.0-latest-win64-gpl-shared-9.0.zip"
- arch: windows/arm64
runner: windows-11-arm
ffmpeg_version: "9.0"
feature: "ndarray,ffmpeg9,link_vcpkg_ffmpeg"
download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n9.0-latest-winarm64-gpl-shared-9.0.zip"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install BtbN FFmpeg
shell: pwsh
run: |
# bindgen needs a libclang.dll whose machine type matches the host. On the
# x64 runner the LLVM shipped with Visual Studio's x64 Clang toolset is fine.
# On the ARM64 runner that x64 libclang.dll cannot be loaded by the ARM64
# process, so fetch the native Windows-on-ARM64 LLVM ("woa64") build instead.
$isArm64 = ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64' -or $env:PROCESSOR_ARCHITEW6432 -eq 'ARM64')
if ($isArm64) {
Invoke-WebRequest "https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/LLVM-18.1.8-woa64.exe" -OutFile llvm-arm64.exe
7z x llvm-arm64.exe -y -ollvm-arm64 | Out-Null
$libclang = @(Get-ChildItem llvm-arm64 -Recurse -Filter libclang.dll -ErrorAction SilentlyContinue | Select-Object -First 1)
if (-not $libclang) { throw "libclang.dll not found in the ARM64 LLVM extract" }
Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=$($libclang[0].DirectoryName)"
} else {
$VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)
Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin"
}
Invoke-WebRequest "${{ matrix.download_url }}" -OutFile ffmpeg.zip
Expand-Archive -Path ffmpeg.zip -DestinationPath ffmpeg -Force
# BtbN zips wrap everything in a single <package>/ dir; flatten it so
# bin/, lib/ and include/ sit directly under ffmpeg/.
Get-ChildItem ffmpeg -Directory | ForEach-Object {
Get-ChildItem $_.FullName -Force | Move-Item -Destination ffmpeg\ -Force
Remove-Item $_.FullName -Force -Recurse
}
Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin"
Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg"
Add-Content $env:GITHUB_ENV "FFMPEG_LIBS_DIR=${pwd}\ffmpeg\lib"
Add-Content $env:GITHUB_ENV "FFMPEG_INCLUDE_DIR=${pwd}\ffmpeg\include"
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt, clippy
- name: Verify FFmpeg version
run: |
echo "FFMPEG_DIR=${env:FFMPEG_DIR}"
echo "FFMPEG_INCLUDE_DIR=${env:FFMPEG_INCLUDE_DIR}"
echo "FFMPEG_LIBS_DIR=${env:FFMPEG_LIBS_DIR}"
& "${env:FFMPEG_DIR}\bin\ffmpeg.exe" -version
- name: Check
run: cargo check --workspace --all-targets --no-default-features --features ${{ matrix.feature }}
- name: Clippy
run: cargo clippy --workspace --all-targets --no-default-features --features ${{ matrix.feature }} -- -D warnings
- name: Run Test
run: cargo test --workspace --all-targets --no-default-features --features ${{ matrix.feature }} --verbose