forked from xiph/rav1e
-
Notifications
You must be signed in to change notification settings - Fork 0
516 lines (500 loc) · 18.5 KB
/
rav1e.yml
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
name: rav1e
on:
push:
branches:
- master
- 0.*
pull_request:
branches:
- master
- 0.*
jobs:
rustfmt-clippy:
if: >-
(github.event_name == 'push' && !endsWith(github.event.head_commit.message, 'CI: skip')) ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.names, 'skip-ci'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ilammy/setup-nasm@v1
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy, rustfmt
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check --verbose
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings --verbose -A clippy::wrong-self-convention -A clippy::many_single_char_names -A clippy::upper-case-acronyms
build-unix:
strategy:
matrix:
conf:
- beta-build
- 1.51.0-tests
- aom-tests
- dav1d-tests
- no-asm-tests
# - grcov-coveralls
- bench
- doc
- cargo-c
- check-no-default
- check-extra-feats
- check-unstable-feats
- fuzz
include:
- conf: beta-build
toolchain: beta
- conf: 1.51.0-tests
toolchain: 1.51.0
- conf: aom-tests
toolchain: stable
- conf: dav1d-tests
toolchain: stable
- conf: no-asm-tests
toolchain: stable
# - conf: grcov-coveralls
# toolchain: stable
- conf: bench
toolchain: stable
- conf: doc
toolchain: stable
- conf: cargo-c
toolchain: stable
- conf: check-no-default
toolchain: stable
- conf: check-extra-feats
toolchain: stable
- conf: check-unstable-feats
toolchain: stable
- conf: fuzz
toolchain: stable
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 300M
SCCACHE_DIR: /home/runner/.cache/sccache
SCCACHE_IDLE_TIMEOUT: 0
if: >-
(github.event_name == 'push' && !endsWith(github.event.head_commit.message, 'CI: skip')) ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.names, 'skip-ci'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set no-asm-tests env vars
if: matrix.conf == 'no-asm-tests'
run: |
echo "name=RAV1E_CPU_TARGET::rust" >> $GITHUB_ENV
- name: Install sccache
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: 0.2.15
run: |
SCCACHE_FILE=sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$LINK/v$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
chmod +x $SCCACHE_FILE/sccache
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Add nasm
env:
LINK: http://debian-archive.trafficmanager.net/debian/pool/main/n/nasm
NASM_VERSION: 2.15.05-1
NASM_SHA256: >-
c860caec653b865d5b83359452d97b11f1b3ba5b18b07cac554cf72550b3bfc9
run: |
echo "$LINK/nasm_${NASM_VERSION}_amd64.deb" >> DEBS
echo "$NASM_SHA256 nasm_${NASM_VERSION}_amd64.deb" >> CHECKSUMS
- name: Add libvmaf
if: >
matrix.conf == '1.51.0-tests' || matrix.conf == 'aom-tests' ||
matrix.conf == 'grcov-coveralls'
env:
LINK: https://www.deb-multimedia.org/pool/main/v/vmaf-dmo
LIBVMAF_VERSION: 2.3.0-dmo1
LIBVMAF_SHA256: >-
2cceb344173fa86dbe665ade28b5a11c54c8426dd2eb3c1d7e242357b016a857
LIBVMAF_DEV_SHA256: >-
fde58300cffa120ab7693bea3d43e9e3d63305e77bbbd9815ad6047b400524d8
run: |
echo "$LINK/libvmaf1_${LIBVMAF_VERSION}_amd64.deb" >> DEBS
echo "$LINK/libvmaf-dev_${LIBVMAF_VERSION}_amd64.deb" >> DEBS
echo "$LIBVMAF_SHA256 libvmaf1_${LIBVMAF_VERSION}_amd64.deb" >> CHECKSUMS
echo "$LIBVMAF_DEV_SHA256 libvmaf-dev_${LIBVMAF_VERSION}_amd64.deb" >> CHECKSUMS
- name: Add aom
if: >
matrix.conf == '1.51.0-tests' || matrix.conf == 'aom-tests' ||
matrix.conf == 'grcov-coveralls'
env:
LINK: https://www.deb-multimedia.org/pool/main/a/aom-dmo
AOM_VERSION: 3.2.0-dmo1
AOM_DEV_SHA256: >-
c63acfea515b81c1c261e79a10094dcca5bf51474f673e51e9d575cdf2476a1e
AOM_LIB_SHA256: >-
dd0b4d9bed079150db74006f18b745c11f6a9103bb005d636514f4c3b8939cec
run: |
echo "$LINK/libaom-dev_${AOM_VERSION}_amd64.deb" >> DEBS
echo "$LINK/libaom3_${AOM_VERSION}_amd64.deb" >> DEBS
echo "$AOM_DEV_SHA256 libaom-dev_${AOM_VERSION}_amd64.deb" >> CHECKSUMS
echo "$AOM_LIB_SHA256 libaom3_${AOM_VERSION}_amd64.deb" >> CHECKSUMS
- name: Add dav1d
if: >
matrix.conf == '1.51.0-tests' || matrix.conf == 'dav1d-tests' ||
matrix.conf == 'grcov-coveralls' || matrix.conf == 'fuzz' || matrix.conf == 'no-asm-tests'
env:
LINK: https://www.deb-multimedia.org/pool/main/d/dav1d-dmo
DAV1D_VERSION: 0.9.2-dmo1
DAV1D_DEV_SHA256: >-
2ed10b35fa2663d2e7ba04d8fe01f0518602008d066cadcb311a5b8105f70f14
DAV1D_LIB_SHA256: >-
1c4336743115b8a512fb984d289cac65c49ad249ba1456940258e53d9c91bd0c
run: |
echo "$LINK/libdav1d-dev_${DAV1D_VERSION}_amd64.deb" >> DEBS
echo "$LINK/libdav1d5_${DAV1D_VERSION}_amd64.deb" >> DEBS
echo "$DAV1D_DEV_SHA256 libdav1d-dev_${DAV1D_VERSION}_amd64.deb" >> CHECKSUMS
echo "$DAV1D_LIB_SHA256 libdav1d5_${DAV1D_VERSION}_amd64.deb" >> CHECKSUMS
- name: Cache packages
uses: actions/cache@v2
continue-on-error: true
id: debs
with:
path: ~/.cache/debs
key: debs-${{ hashFiles('CHECKSUMS') }}
- name: Fetch packages
if: steps.debs.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.cache/debs
cp DEBS CHECKSUMS ~/.cache/debs
cd ~/.cache/debs
xargs -a DEBS curl --remote-name-all
sha256sum -c CHECKSUMS
- name: Install packages
run: |
sudo dpkg -i ~/.cache/debs/*.deb
- name: Install cargo-c
if: matrix.conf == 'cargo-c'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/download
CARGO_C_VERSION: 0.8.0
run: |
curl -L "$LINK/v$CARGO_C_VERSION/cargo-c-linux.tar.gz" |
tar xz -C $HOME/.cargo/bin
- name: Install grcov
if: matrix.conf == 'grcov-coveralls'
env:
LINK: https://github.com/mozilla/grcov/releases/download
GRCOV_VERSION: 0.7.1
run: |
curl -L "$LINK/v$GRCOV_VERSION/grcov-linux-x86_64.tar.bz2" |
tar xj -C $HOME/.cargo/bin
- name: Install ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- name: Generate Cargo.lock and Cargo.version
run: |
cargo update
cargo --version > Cargo.version
- name: Cache cargo registry
uses: actions/cache@v2
continue-on-error: true
with:
path: ~/.cargo/registry/cache
key: ${{ runner.os }}-${{ matrix.conf }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-cargo-registry-
- name: Cache sccache output
uses: actions/cache@v2
continue-on-error: true
with:
path: /home/runner/.cache/sccache
key: ${{ runner.os }}-${{ matrix.conf }}-sccache-${{ hashFiles('**/Cargo.*') }}
restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-sccache-
- name: Start sccache server
run: |
sccache --start-server
- name: Run 1.51.0 tests
if: matrix.toolchain == '1.51.0' && matrix.conf == '1.51.0-tests'
run: |
cargo test --workspace --verbose \
--features=decode_test,decode_test_dav1d,quick_test,capi
- name: Run aom tests
if: matrix.toolchain == 'stable' && matrix.conf == 'aom-tests'
run: |
cargo test --workspace --verbose --release \
--features=decode_test \
--color=always -- --color=always --ignored
- name: Run dav1d tests
if: matrix.toolchain == 'stable' && (matrix.conf == 'dav1d-tests' || matrix.conf == 'no-asm-tests')
run: |
cargo test --workspace --verbose --release \
--features=decode_test_dav1d \
--color=always -- --color=always --ignored
- name: Run build
if: matrix.conf == 'beta-build'
run: |
cargo build --verbose
- name: Run bench
if: matrix.toolchain == 'stable' && matrix.conf == 'bench'
run: |
cargo bench --features=bench --no-run --verbose
- name: Run doc
if: matrix.toolchain == 'stable' && matrix.conf == 'doc'
run: |
cargo doc --verbose --no-deps
- name: Check no default features
if: matrix.toolchain == 'stable' && matrix.conf == 'check-no-default'
run: |
cargo check --no-default-features
- name: Check extra features
if: matrix.toolchain == 'stable' && matrix.conf == 'check-extra-feats'
run: |
cargo check --features=check_asm,capi,dump_lookahead_data,serialize,bench --all-targets
- name: Check extra features
if: matrix.toolchain == 'stable' && matrix.conf == 'check-unstable-feats'
run: |
cargo check --features=unstable,channel-api
- name: Run cargo-c
if: matrix.conf == 'cargo-c'
run: |
cargo cbuild
- name: Install cargo-fuzz
if: matrix.conf == 'fuzz'
run: |
cargo install cargo-fuzz
- name: Run cargo-fuzz
if: matrix.conf == 'fuzz'
run: |
cargo fuzz build --sanitizer none
- name: Run cargo clean
if: matrix.conf == 'grcov-coveralls'
uses: actions-rs/cargo@v1
with:
command: clean
- name: Run tests with coverage
if: matrix.conf == 'grcov-coveralls'
env:
CARGO_INCREMENTAL: 0
RUSTC_BOOTSTRAP: 1
RUSTFLAGS: >
-Zprofile -Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off
-Cpanic=abort -Zpanic_abort_tests
RUSTDOCFLAGS: >
-Zprofile -Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off
-Cpanic=abort -Zpanic_abort_tests
run: |
cargo test --workspace --verbose --target x86_64-unknown-linux-gnu \
--features=decode_test,decode_test_dav1d,quick_test
- name: Run unit tests
if: matrix.conf == 'no-asm-tests'
run: |
cargo test --workspace --verbose
- name: Run grcov
if: matrix.conf == 'grcov-coveralls'
id: coverage
uses: actions-rs/grcov@v0.1
- name: Stop sccache server
run: |
sccache --stop-server
- name: Coveralls upload
if: matrix.conf == 'grcov-coveralls'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ steps.coverage.outputs.report }}
build-macos:
strategy:
matrix:
include:
- name: Cargo build (x64)
conf: cargo-build
target: x86_64-apple-darwin
- name: Cargo test (x64)
conf: cargo-test
target: x86_64-apple-darwin
- name: Cargo C-build (x64)
conf: cargo-c
target: x86_64-apple-darwin
- name: Cargo build (Arm64)
conf: cargo-build
target: aarch64-apple-darwin
- name: Cargo C-build (Arm64)
conf: cargo-c
target: aarch64-apple-darwin
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 300M
SCCACHE_DIR: /Users/runner/Library/Caches/Mozilla.sccache
if: >-
(github.event_name == 'push' && !endsWith(github.event.head_commit.message, 'CI: skip')) ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.names, 'skip-ci'))
runs-on: macos-11.0
steps:
- uses: actions/checkout@v2
- name: Install sccache
run: |
brew install sccache
- name: Install nasm
run: |
brew install nasm
- name: Install cargo-c
if: matrix.conf == 'cargo-c'
run: |
brew install cargo-c
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.target }}
default: true
- name: Generate Cargo.lock and Cargo.version
run: |
cargo update
cargo --version > Cargo.version
- name: Cache cargo registry
uses: actions/cache@v2
continue-on-error: true
with:
path: ~/.cargo/registry/cache
key: ${{ runner.os }}-${{ matrix.conf }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-cargo-registry-
- name: Cache sccache output
uses: actions/cache@v2
continue-on-error: true
with:
path: /Users/runner/Library/Caches/Mozilla.sccache
key: ${{ runner.os }}-${{ matrix.conf }}-sccache-${{ hashFiles('**/Cargo.*') }}
restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-sccache-
- name: Start sccache server
run: |
sccache --start-server
- name: Build
if: matrix.conf == 'cargo-build'
run: |
cargo build --release --target=${{ matrix.target }}
- name: Test
if: matrix.conf == 'cargo-test'
run: |
cargo test --workspace --verbose --target=${{ matrix.target }}
- name: Run cargo-c
if: matrix.conf == 'cargo-c'
run: |
cargo cbuild --target=${{ matrix.target }}
- name: Stop sccache server
run: |
sccache --stop-server
build-windows:
strategy:
matrix:
include:
- conf: cargo-build
target: x86_64-pc-windows-msvc
- conf: cargo-build
target: aarch64-pc-windows-msvc
- conf: cargo-test
target: x86_64-pc-windows-msvc
- conf: cargo-c
target: x86_64-pc-windows-gnu
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 300M
SCCACHE_DIR: C:\sccache
if: >-
(github.event_name == 'push' && !endsWith(github.event.head_commit.message, 'CI: skip')) ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.names, 'skip-ci'))
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: ilammy/setup-nasm@v1
- name: Install sccache
run: |
$LINK = "https://github.com/mozilla/sccache/releases/download/0.2.12"
$SCCACHE_FILE = "sccache-0.2.12-x86_64-pc-windows-msvc"
curl -LO "$LINK/$SCCACHE_FILE.tar.gz"
tar xzf "$SCCACHE_FILE.tar.gz"
echo "$Env:GITHUB_WORKSPACE/$SCCACHE_FILE" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Set MSVC x86_64 linker path
if: matrix.target != 'aarch64-pc-windows-msvc'
run: |
$LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\x64"
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
$LinkPath = vswhere -latest -products * -find "$LinkGlob" | Select-Object -Last 1
echo "$LinkPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Set MSVC Arm64 linker path
if: matrix.target == 'aarch64-pc-windows-msvc'
run: |
$LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\Arm64"
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
$LinkPath = vswhere -latest -products * -find "$LinkGlob" | Select-Object -Last 1
echo "$LinkPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
default: true
- name: Install cargo-c
if: matrix.conf == 'cargo-c'
run: |
$LINK = "https://github.com/lu-zero/cargo-c/releases/download/v0.8.0"
$CARGO_C_FILE = "cargo-c-windows-msvc"
curl -LO "$LINK/$CARGO_C_FILE.zip"
7z e -y "$CARGO_C_FILE.zip" -o"${env:USERPROFILE}\.cargo\bin"
- name: Generate Cargo.lock and Cargo.version
run: |
cargo update
cargo --version > Cargo.version
- name: Cache cargo registry
uses: actions/cache@v2
continue-on-error: true
with:
path: ~/.cargo/registry/cache
key: ${{ runner.os }}-${{ matrix.conf }}-${{ matrix.target }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-${{ matrix.target }}-cargo-registry-
- name: Cache sccache output
uses: actions/cache@v2
continue-on-error: true
with:
path: C:\sccache
key: ${{ runner.os }}-${{ matrix.conf }}-${{ matrix.target }}-sccache-${{ hashFiles('**/Cargo.*') }}
restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-${{ matrix.target }}-sccache-
- name: Start sccache server
run: |
sccache --start-server
- name: Build
if: matrix.conf == 'cargo-build'
run: |
cargo build --release
- name: Test
if: matrix.conf == 'cargo-test'
run: |
cargo test --workspace --verbose
- name: Run cargo-c
if: matrix.conf == 'cargo-c'
run: |
cargo cbuild
- name: Stop sccache server
run: |
sccache --stop-server