14
14
jobs :
15
15
16
16
rustfmt_check :
17
- runs-on : ubuntu-latest
17
+ strategy :
18
+ matrix :
19
+ os : [macos-latest, windows-latest, ubuntu-latest]
20
+ fail-fast : false
21
+ runs-on : ${{ matrix.os }}
18
22
steps :
19
23
- uses : actions/checkout@v2
20
24
- uses : actions-rs/toolchain@v1
28
32
command : fmt
29
33
args : --all -- --check
30
34
31
- # Interestingly clippy check needs to build the crate.
32
- rust_clippy_check :
35
+ rust_clippy_check_ubuntu :
33
36
runs-on : ubuntu-latest
34
37
steps :
35
38
- uses : actions/checkout@v2
48
51
49
52
- run : cargo clippy -- -D warnings
50
53
51
- build_and_test :
54
+ rust_clippy_check_windows :
55
+ runs-on : windows-latest
56
+ steps :
57
+ - uses : actions/checkout@v2
58
+ - uses : actions-rs/toolchain@v1
59
+ with :
60
+ profile : minimal
61
+ toolchain : stable
62
+ override : true
63
+ # Using this since it's used by clang-sys's CI
64
+ - name : Install LLVM and Clang
65
+ uses : KyleMayes/install-llvm-action@v1
66
+ with :
67
+ version : " 10.0"
68
+ directory : ${{ github.workspace }}/clang
69
+
70
+ - name : Clone vcpkg FFmpeg
71
+ run : git clone https://github.com/microsoft/vcpkg --depth 1
72
+ - name : Bootstrap vcpkg FFmpeg
73
+ run : ./vcpkg/bootstrap-vcpkg.bat
74
+ - name : Vcpkg install ffmpeg
75
+ run : ./vcpkg/vcpkg.exe install ffmpeg:x64-windows-static-md
76
+
77
+ - name : Clippy check
78
+ env :
79
+ VCPKG_ROOT : ${{ github.workspace }}/vcpkg
80
+ LIBCLANG_PATH : ${{ github.workspace }}/clang/lib
81
+ LLVM_CONFIG_PATH : ${{ github.workspace }}/clang/bin/llvm-config
82
+ run : cargo clippy -- -D warnings
83
+
84
+ build_and_test_ubuntu :
52
85
runs-on : ubuntu-latest
53
86
steps :
54
87
- uses : actions/checkout@v2
@@ -100,9 +133,7 @@ jobs:
100
133
101
134
- name : Run Slice Example
102
135
run : cargo run --example slice
103
- # Avoid the situation that example outputs incorrect results.
104
- # (Is this really essential? Maybe I'm too anxious?)
105
- - name : Check No Change
136
+ - name : Check test result correctness
106
137
run : |
107
138
if [[ -z "$(git status --porcelain)" ]]; then
108
139
echo "0"
@@ -226,7 +257,7 @@ jobs:
226
257
hash -r
227
258
cd ..
228
259
- name : Binding Build
229
- run : PKG_CONFIG_PATH ="$HOME/ffmpeg_build/lib/pkgconfig" cargo build --verbose
260
+ run : FFMPEG_PKG_CONFIG_PATH ="$HOME/ffmpeg_build/lib/pkgconfig" cargo build --verbose
230
261
231
262
build_with_system_ffmpeg :
232
263
runs-on : ubuntu-latest
@@ -247,6 +278,69 @@ jobs:
247
278
- name : Binding Build
248
279
run : cargo build --verbose
249
280
281
+ build_with_vcpkg_ffmpeg_windows :
282
+ runs-on : windows-latest
283
+ strategy :
284
+ matrix :
285
+ config :
286
+ - target : " x86_64-pc-windows-msvc"
287
+ vcpkg_triplet : " x64-windows-static"
288
+ rustflags : " -Ctarget-feature=+crt-static"
289
+ - target : " x86_64-pc-windows-msvc"
290
+ vcpkg_triplet : " x64-windows-static-md"
291
+ - target : " x86_64-pc-windows-msvc"
292
+ vcpkg_triplet : " x64-windows"
293
+ dynamic : true
294
+
295
+ - target : " i686-pc-windows-msvc"
296
+ vcpkg_triplet : " x86-windows-static"
297
+ rustflags : " -Ctarget-feature=+crt-static"
298
+ - target : " i686-pc-windows-msvc"
299
+ vcpkg_triplet : " x86-windows-static-md"
300
+ - target : " i686-pc-windows-msvc"
301
+ vcpkg_triplet : " x86-windows"
302
+ dynamic : true
303
+ fail-fast : false
304
+ steps :
305
+ - uses : actions/checkout@v2
306
+ # Using this since it's used by clang-sys's CI
307
+ - name : Install LLVM and Clang
308
+ uses : KyleMayes/install-llvm-action@v1
309
+ with :
310
+ version : " 10.0"
311
+ directory : ${{ github.workspace }}/clang
312
+
313
+ - uses : actions-rs/toolchain@v1
314
+ with :
315
+ profile : minimal
316
+ toolchain : stable
317
+ override : true
318
+ target : ${{ matrix.config.target }}
319
+
320
+ - name : Clone vcpkg FFmpeg
321
+ run : git clone https://github.com/microsoft/vcpkg --depth 1
322
+ - name : Bootstrap vcpkg FFmpeg
323
+ run : ./vcpkg/bootstrap-vcpkg.bat
324
+ - name : Vcpkg install ffmpeg
325
+ run : ./vcpkg/vcpkg.exe install ffmpeg:${{ matrix.config.vcpkg_triplet }}
326
+
327
+ - name : Set env
328
+ shell : bash
329
+ run : |
330
+ if [ '${{ matrix.config.dynamic }}' != '' ]; then
331
+ echo "FFMPEG_DYNAMIC_LINKING=1" >> $GITHUB_ENV
332
+ fi
333
+
334
+ - name : Binding build
335
+ shell : bash
336
+ env :
337
+ VCPKG_ROOT : ${{ github.workspace }}/vcpkg
338
+ RUSTFLAGS : ${{ matrix.config.rustflags}}
339
+ VCPKG_DEFAULT_TRIPLET : ${{ matrix.config.vcpkg_triplet }}
340
+ LIBCLANG_PATH : ${{ github.workspace }}/clang/lib
341
+ LLVM_CONFIG_PATH : ${{ github.workspace }}/clang/bin/llvm-config
342
+ run : cargo build --target ${{ matrix.config.target }} --verbose
343
+
250
344
# Check if correct documentation can be generated by docs.rs
251
345
docs_rs_check :
252
346
runs-on : ubuntu-latest
@@ -291,7 +385,9 @@ jobs:
291
385
sudo apt-get -y install libmp3lame-dev
292
386
sudo apt-get -y install libopus-dev
293
387
388
+ - name : Set env
389
+ run : echo "DOCS_RS=1" >> $GITHUB_ENV
294
390
- name : Binding Build
295
- run : DOCS_RS=1 cargo build --verbose
391
+ run : cargo build --verbose
296
392
- name : Document Generation
297
393
run : cargo doc --verbose
0 commit comments