name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang \
libclang-dev \
libdrm-dev \
libgbm-dev \
libva-dev \
pkg-config \
ripgrep
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Check formatting
run: cargo fmt --all --check
- name: Check core library
run: cargo check --no-default-features
- name: Run Clippy on the maintained VA-API surface
run: |
cargo clippy \
--no-default-features \
--features vaapi \
--lib \
--test generic_vaapi_constructor
- name: Test generic VA-API constructor
run: |
cargo test \
--no-default-features \
--features vaapi \
--test generic_vaapi_constructor
- name: Check VA-API with DMA-BUF compatibility
run: |
cargo check \
--no-default-features \
--features vaapi,dmabuf \
--lib
- name: Check the upstream C2 VA-API compatibility path
run: |
cargo check \
--no-default-features \
--features c2,vaapi \
--examples
- name: Check VA-API dependency boundary
run: |
if cargo tree --no-default-features --features vaapi -e normal \
| rg '(^| )(gbm|gbm-sys|drm|drm-fourcc) v'; then
echo "The vaapi feature unexpectedly enables DMA-BUF dependencies"
exit 1
fi
- name: Check package contents
run: cargo publish --dry-run