playr 0.6.1

A minimal TUI music player that plays local files and contacts nothing
Documentation
# Runs the test suite on every branch push and pull request, on each platform
# releases are built for, so a failure shows before a version is tagged.
name: test

on:
  push:
    branches: ["**"]
  pull_request:

permissions:
  contents: read

# A newer push to the same branch replaces a run still in progress.
concurrency:
  group: test-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always
  # The format and scanner tests fail instead of skipping without ffmpeg.
  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

      # ALSA for playback; the rest for the desktop window's windowing libraries.
      - 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

      # Every runner makes its test audio with ffmpeg 9.0. Ubuntu 22.04's own
      # package is 4.4, whose encoders write different files, so Linux takes
      # BtbN's static build of the 9.0 series, which updates within 9.0.
      - 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

      # Named in the log, since the test audio depends on it.
      - name: ffmpeg version
        shell: bash
        run: ffmpeg -version | head -1

      - uses: dtolnay/rust-toolchain@stable

      - uses: Swatinem/rust-cache@v2

      # --no-fail-fast, so one run reports every failing test binary, not the first.
      - name: Test without Opus
        run: cargo test --workspace --no-fail-fast

      - name: Test with Opus
        run: cargo test --workspace --no-fail-fast --features opus

  # The rust-version in Cargo.toml, for every crate but playr-gui, which
  # declares egui's own. Keep the toolchain below equal to it.
  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