1
+ name : ci
2
+
3
+ on :
4
+ push :
5
+ branches : [ "main" ]
6
+ paths-ignore :
7
+ - ' README.md'
8
+ pull_request :
9
+ branches : [ "main" ]
10
+ paths-ignore :
11
+ - ' README.md'
12
+
13
+ env :
14
+ CARGO_TERM_COLOR : always
15
+
16
+ jobs :
17
+
18
+ build-linux :
19
+ name : build / linux / ffmpeg ${{ matrix.ffmpeg_version }}
20
+ runs-on : ubuntu-latest
21
+ container : jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu
22
+
23
+ strategy :
24
+ matrix :
25
+ include :
26
+ # FFmpeg 7.x
27
+ - ffmpeg_version : " 7.1"
28
+ feature : " rsmpeg,image,ndarray,nalgebra,imageproc"
29
+ fail-fast : false
30
+
31
+ steps :
32
+ - name : Checkout
33
+ uses : actions/checkout@v4
34
+
35
+ - name : Install dependencies
36
+ run : |
37
+ DEBIAN_FRONTEND=noninteractive apt-get update
38
+ DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential ca-certificates clang curl pkg-config
39
+
40
+ - name : Setup Rust
41
+ uses : dtolnay/rust-toolchain@stable
42
+
43
+ - name : Build
44
+ run : cargo build --no-default-features --features ${{ matrix.feature }} --verbose
45
+
46
+ - name : Run Test
47
+ run : cargo test --no-default-features --features ${{ matrix.feature }} --verbose
48
+
49
+ build-macos :
50
+ name : build / macos / latest ffmpeg
51
+ runs-on : macos-latest
52
+
53
+ steps :
54
+ - name : Checkout
55
+ uses : actions/checkout@v4
56
+
57
+ - name : Install dependencies
58
+ run : |
59
+ brew install ffmpeg pkg-config
60
+
61
+ - name : Setup Rust
62
+ uses : dtolnay/rust-toolchain@stable
63
+
64
+ - name : Build
65
+ run : cargo build --no-default-features --features ${{ matrix.feature }} --verbose
66
+
67
+ - name : Run Test
68
+ run : cargo test --no-default-features --features ${{ matrix.feature }} --verbose
69
+
70
+ build-windows :
71
+ name : build / windows / latest ffmpeg
72
+ runs-on : windows-latest
73
+
74
+ env :
75
+ FFMPEG_DOWNLOAD_URL : https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z
76
+ RUST_BACKTRACE : 1
77
+
78
+ steps :
79
+ - name : Checkout
80
+ uses : actions/checkout@v4
81
+
82
+ - name : Install dependencies
83
+ run : |
84
+ $VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)
85
+ Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n"
86
+ Invoke-WebRequest "${env:FFMPEG_DOWNLOAD_URL}" -OutFile ffmpeg-release-full-shared.7z
87
+ 7z x ffmpeg-release-full-shared.7z
88
+ mv ffmpeg-*/* ffmpeg/
89
+ Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n"
90
+ Add-Content $env:GITHUB_ENV "FFMPEG_INCLUDE_DIR=${pwd}\ffmpeg\include`n"
91
+ Add-Content $env:GITHUB_ENV "FFMPEG_LIBS_DIR=${pwd}\ffmpeg\lib`n"
92
+ Add-Content $env:GITHUB_ENV "FFMPEG_DLL_PATH=${pwd}\ffmpeg\bin`n"
93
+ Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n"
94
+
95
+ - name : Setup Rust
96
+ uses : dtolnay/rust-toolchain@stable
97
+
98
+ - name : Build
99
+ run : cargo build --no-default-features --features ${{ matrix.feature }} --verbose
100
+
101
+ - name : Run Test
102
+ run : cargo test --no-default-features --features ${{ matrix.feature }} --verbose
103
+
104
+ test :
105
+ runs-on : ubuntu-latest
106
+ container : jrottenberg/ffmpeg:7.1-ubuntu
107
+
108
+ steps :
109
+ - name : Checkout
110
+ uses : actions/checkout@v4
111
+
112
+ - name : Install dependencies
113
+ run : |
114
+ DEBIAN_FRONTEND=noninteractive apt-get update
115
+ DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential ca-certificates clang curl pkg-config
116
+
117
+ # - name: Setup Rust
118
+ # uses: dtolnay/rust-toolchain@stable
119
+ - name : Setup Rust
120
+ uses : dtolnay/rust-toolchain@nightly
121
+
122
+ - name : Test
123
+ run : cargo +nightly test --no-default-features --features ${{ matrix.feature }} --verbose
124
+
125
+ lints :
126
+ runs-on : ubuntu-latest
127
+ container : jrottenberg/ffmpeg:7.1-ubuntu
128
+
129
+ steps :
130
+ - name : Checkout
131
+ uses : actions/checkout@v4
132
+
133
+ - name : Install dependencies
134
+ run : |
135
+ DEBIAN_FRONTEND=noninteractive apt-get update
136
+ DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential ca-certificates clang curl pkg-config
137
+
138
+ - name : Setup Rust
139
+ uses : dtolnay/rust-toolchain@stable
140
+ with :
141
+ components : rustfmt, clippy
142
+
143
+ - name : Rustfmt
144
+ run : cargo fmt --all -- --all-features --check
145
+
146
+ - name : Clippy
147
+ run : cargo clippy --all --no-default-features --features ${{ matrix.feature }} -- -D warnings
0 commit comments