Skip to content

chore: update README #56

chore: update README

chore: update README #56

Workflow file for this run

name: CI / mediadecode-webcodecs
# Triggered by changes to either the WebCodecs adapter, the core
# crate it adapts (since core changes can break the adapter), or
# shared workspace files. The crate is `wasm32`-only — every
# job here builds against `wasm32-unknown-unknown`.
on:
push:
branches: [main]
paths:
- 'mediadecode/**'
- 'mediadecode-webcodecs/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci-webcodecs.yml'
pull_request:
paths:
- 'mediadecode/**'
- 'mediadecode-webcodecs/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci-webcodecs.yml'
workflow_dispatch:
schedule:
- cron: "0 1 1 * *"
env:
CARGO_TERM_COLOR: always
# `web-sys` gates WebCodecs APIs behind `--cfg web_sys_unstable_apis`.
# `.cargo/config.toml` already sets this for `cargo` invocations,
# but env-level `RUSTFLAGS` displaces config-file rustflags entirely
# — combine both here so deny-warnings and the unstable cfg coexist.
RUSTFLAGS: "-Dwarnings --cfg=web_sys_unstable_apis"
# rustdoc (used by `cargo test --doc`) reads `RUSTDOCFLAGS`, not
# `RUSTFLAGS`, so the cfg has to be repeated here or the
# `compile_error!` gate in the crate's `lib.rs` fires during
# doctest runs.
RUSTDOCFLAGS: "--cfg=web_sys_unstable_apis"
RUST_BACKTRACE: 1
jobs:
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- name: Check formatting
run: cargo fmt -p mediadecode-webcodecs -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust
run: |
rustup update stable && rustup default stable
rustup component add clippy
rustup target add wasm32-unknown-unknown
- name: Install cargo-hack
run: cargo install cargo-hack
- name: Apply clippy lints
run: cargo hack clippy -p mediadecode-webcodecs --target wasm32-unknown-unknown --each-feature --exclude-no-default-features
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Cache cargo build and registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-webcodecs-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-webcodecs-build-
- name: Install Rust
run: |
rustup update stable && rustup default stable
rustup target add wasm32-unknown-unknown
- name: Install cargo-hack
run: cargo install cargo-hack
- name: Run build
run: cargo hack build -p mediadecode-webcodecs --target wasm32-unknown-unknown --feature-powerset --exclude-no-default-features
test:
name: test (wasm-bindgen-test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
# Audio fixtures live at `tests/fixtures/audio/` as a
# submodule pointing at `findit-ai/audio-fixtures`
# (~283 MiB of mono 16 kHz pcm_s16le clips).
submodules: recursive
- name: Cache cargo build and registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-webcodecs-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-webcodecs-test-
- name: Install Rust
run: |
rustup update stable && rustup default stable
rustup target add wasm32-unknown-unknown
- name: Install wasm-bindgen-test-runner + wasm-pack
run: |
cargo install wasm-bindgen-cli --locked
cargo install wasm-pack --locked
- name: Install Chromium + chromedriver
run: |
sudo apt-get update -y
sudo apt-get install -y chromium-browser chromium-chromedriver
- name: Run wasm-bindgen-test in headless Chromium
env:
CHROMEDRIVER: /usr/bin/chromedriver
# `cargo test --target wasm32-unknown-unknown` alone only
# builds — the produced `.wasm` is not a native binary, so
# cargo's default test runner exits 126 trying to execute
# it. Route through `wasm-bindgen-test-runner` (set via
# `CARGO_TARGET_..._RUNNER`) so the test harness actually
# boots in headless Chromium.
run: |
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER="wasm-bindgen-test-runner"
cargo test -p mediadecode-webcodecs --target wasm32-unknown-unknown