Skip to content

Build

Build #1251

Workflow file for this run

name: Build
env:
RUST_BACKTRACE: 1
on:
push:
pull_request:
schedule:
- cron: '0 10 * * *'
jobs:
build:
name: Build Rust ${{ matrix.rust }} on ${{ matrix.os }}, release=${{ matrix.release }} features=${{ matrix.features }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
rust: [stable]
release: [true, false]
experimental: [false]
features: ["", "missing-pixi-permitted"]
include:
- os: ubuntu-20.04
rust: nightly
release: false
experimental: false
- os: windows-2019
rust: nightly
release: false
experimental: false
- os: macos-10.15
rust: nightly
release: false
experimental: false
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Rust
run: rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt clippy
- name: Check format
shell: bash
run: rustup run ${{ matrix.rust }} cargo fmt --all -- --check
- name: Clippy (default features)
shell: bash
run: rustup run ${{ matrix.rust }} cargo clippy --all --bins --all-targets --examples --benches --tests -- -D warnings
- name: Clippy (all features)
shell: bash
run: rustup run ${{ matrix.rust }} cargo clippy --all --all-features --bins --all-targets --examples --benches --tests -- -D warnings
- name: Test (release)
shell: bash
run: rustup run ${{ matrix.rust }} cargo test --all --features "${{ matrix.features }}" --verbose --release -- --nocapture
if: matrix.release
- name: Test (debug)
shell: bash
run: rustup run ${{ matrix.rust }} cargo test --all --features "${{ matrix.features }}" --verbose -- --nocapture
if: ${{ !matrix.release }}
- name: Doc (release)
shell: bash
run: rustup run ${{ matrix.rust }} cargo doc --document-private-items
env:
RUSTDOCFLAGS: "-Dwarnings"
if: matrix.release
# cargo-fuzz supports x86-64 Linux and x86-64 macOS, but macOS currently fails, see:
# https://github.com/mozilla/mp4parse-rust/pull/210#issuecomment-597420191
- name: Install cargo-fuzz
run: rustup run ${{ matrix.rust }} cargo install cargo-fuzz
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.rust == 'nightly' }}
- name: Build fuzzer
working-directory: mp4parse_capi
run: rustup run ${{ matrix.rust }} cargo fuzz build
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.rust == 'nightly' }}
- name: Clippy fuzzer
working-directory: mp4parse_capi/fuzz
run: rustup run ${{ matrix.rust }} cargo clippy -- -D warnings
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.rust == 'nightly' }}