Skip to content

Use checked_add in utils/clap.rs #9

Use checked_add in utils/clap.rs

Use checked_add in utils/clap.rs #9

name: Conformance Tests
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
# Cancel the workflow if a new one is triggered from the same PR, branch, or tag, except on main.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
conformance-tests:
name: "Conformance Tests on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Visual Studio shell
if: runner.os == 'Windows'
uses: egor-tensin/vs-shell@9a932a62d05192eae18ca370155cf877eecc2202 # v2.1
- name: Cache external dependencies including libavif
id: cache-ext-with-libavif
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: |
sys
external
key: ${{ runner.os }}-${{ hashFiles('sys/dav1d-sys/Cargo.toml', 'sys/dav1d-sys/dav1d.cmd', 'sys/dav1d-sys/build.rs', 'sys/libyuv-sys/Cargo.toml', 'sys/libyuv-sys/libyuv.cmd', 'sys/libyuv-sys/build.rs', 'external/googletest.cmd') }}
- uses: jwlawson/actions-setup-cmake@d06b37b47cfd043ec794ffa3e40e0b6b5858a7ec # v1.14.2
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
- uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
- uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
- run: pip install meson
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
- name: Build dav1d
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
working-directory: ./sys/dav1d-sys
run: ./dav1d.cmd
- name: Build libyuv
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
working-directory: ./sys/libyuv-sys
run: ./libyuv.cmd
- name: Clone av1-avif (specification repository for testFiles)
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
working-directory: ./external
run: |
git clone https://github.com/AOMediaCodec/av1-avif.git
cd av1-avif
git checkout 77bd20d59d7cade4ab98f276ff4828433ebd089b
- name: Clone libavif
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
working-directory: ./external
run: |
git clone https://github.com/AOMediaCodec/libavif.git
cd libavif
git checkout da70b0177613ae94b18a8467ca70b03d2276f099
- name: Copy dav1d into libavif (for windows)
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true' && runner.os == 'Windows'
working-directory: ./external/libavif
run: xcopy ..\..\sys\dav1d-sys\dav1d ext\dav1d /s /e /h /i
- name: Copy dav1d into libavif (for linux/mac)
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true' && runner.os != 'Windows'
working-directory: ./external/libavif
run: cp -R ../../sys/dav1d-sys/dav1d ext/dav1d
- name: Set up ext/zlib for libavif
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
working-directory: ./external/libavif/ext
run: ./zlibpng.cmd
- name: Set up ext/libjpeg for libavif
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
working-directory: ./external/libavif/ext
run: ./libjpeg.cmd
- name: Configure libavif (cmake)
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
working-directory: ./external/libavif
run: >
cmake -S . -B build -G Ninja
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF
-DAVIF_CODEC_DAV1D=LOCAL -DAVIF_JPEG=LOCAL -DAVIF_LIBYUV=0
-DAVIF_ZLIBPNG=LOCAL -DAVIF_BUILD_APPS=ON
- name: Build libavif (avifdec for conformance comparison)
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true'
working-directory: ./external/libavif/build
run: ninja avifdec
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
toolchain: stable
- name: Build and run the Rust tests
# TODO: https://github.com/AOMediaCodec/av1-avif/issues/217 - Enable test 166
run: cargo test -- test_conformance --skip test_conformance::_166_expects
- name: Build GoogleTest
if: steps.cache-ext-with-libavif.outputs.cache-hit != 'true' && runner.os == 'Linux'
working-directory: ./external
run: bash -e googletest.cmd
- name: Build and run the C++ tests
if: runner.os == 'Linux'
run: |
cargo build --features capi --release
cmake -S c_api_tests -B c_build
make -C c_build
ctest --test-dir c_build -R conformance_tests