name: test
on:
push:
branches: ["**"]
pull_request:
permissions:
contents: read
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
PLAYR_REQUIRE_FFMPEG: "1"
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Install ALSA headers and ffmpeg
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libasound2-dev ffmpeg
- name: Install ffmpeg
if: runner.os == 'macOS'
run: brew install ffmpeg
- name: Install ffmpeg
if: runner.os == 'Windows'
run: choco install ffmpeg -y --no-progress
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Test without Opus
run: cargo test --workspace --no-fail-fast
- name: Test with Opus
run: cargo test --workspace --no-fail-fast --features opus
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- name: Install ALSA headers
run: sudo apt-get update && sudo apt-get install -y libasound2-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Formatting
run: cargo fmt --all --check
- name: Clippy, with and without Opus
run: make clippy