name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
SVT_AV1_REV: d3c4cb3947a8bfed0aa5a2be996b37bb117fa1bd
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: amd64
- os: ubuntu-24.04-arm
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends cmake nasm pkg-config libdav1d-dev
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Cache SVT-AV1
id: svt-cache
uses: actions/cache@v4
with:
path: svt-install
key: svt-av1-${{ env.SVT_AV1_REV }}-${{ matrix.arch }}
- name: Build SVT-AV1
if: steps.svt-cache.outputs.cache-hit != 'true'
run: |
git clone --depth 1 https://gitlab.com/AOMediaCodec/SVT-AV1.git svt
git -C svt fetch --depth 1 origin "$SVT_AV1_REV"
git -C svt checkout "$SVT_AV1_REV"
cmake -S svt -B svt/build -DCMAKE_BUILD_TYPE=Release \
-DBUILD_APPS=OFF -DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX="$PWD/svt-install" -DCMAKE_INSTALL_LIBDIR=lib
make -C svt/build -j"$(nproc)" install
rm -rf svt
- name: Install SVT-AV1
run: |
sudo cp -r svt-install/* /usr/local/
sudo ldconfig
- name: Format
if: matrix.arch == 'amd64'
run: cargo fmt --check
- name: Clippy (default features)
run: cargo clippy --release --all-targets -- -D warnings
- name: Clippy (avif)
run: cargo clippy --release --all-targets --features avif -- -D warnings
- name: Test (default features)
run: cargo test --release
- name: Test (avif)
run: cargo test --release --features avif
- name: Build all targets
run: cargo build --release --all-targets --features avif