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 window libraries
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libxkbcommon-dev libwayland-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Install ffmpeg
if: runner.os == 'Linux'
run: |
build=ffmpeg-n9.0-latest-linux64-gpl-9.0
curl -fsSL "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/$build.tar.xz" | tar xJ -C "$RUNNER_TEMP"
echo "$RUNNER_TEMP/$build/bin" >> "$GITHUB_PATH"
- 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
- name: ffmpeg version
shell: bash
run: ffmpeg -version | head -1
- 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
msrv:
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@1.89
- uses: Swatinem/rust-cache@v2
- name: Check on the declared rust-version, with Opus
run: cargo check -p playr -p playr-core -p playr-app --all-targets --features opus
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- name: Install ALSA headers and window libraries
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libxkbcommon-dev libwayland-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-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