mp4box 0.12.0

MP4/ISOBMFF parser and editor: box trees, typed decoding, sample tables, fragmented MP4, and non-destructive editing
Documentation
name: CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

permissions:
  contents: read

jobs:
  build-and-test:
    name: Rust fmt / clippy / test
    runs-on: ubuntu-latest

    env:
      CARGO_TERM_COLOR: always
      # Pinned test fixtures land here; the real-file tests read this dir.
      MP4_FIXTURES_DIR: ${{ github.workspace }}/target/fixtures

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Show rustc / cargo versions
        run: |
          rustc -V
          cargo -V

      - name: Cache cargo registry + target
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: |
            ${{ runner.os }}-cargo-

      - name: Fetch pinned test fixtures
        run: |
          if ! command -v zstd >/dev/null 2>&1; then
            sudo apt-get update && sudo apt-get install -y zstd
          fi
          scripts/fetch-fixtures.sh

      - name: cargo fmt
        run: cargo fmt --all --check

      - name: cargo clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: cargo test
        run: cargo test --all --all-features