audio_thread_priority 0.35.0

Bump a thread to real-time priority, for audio work, on Linux, Android, Windows and macOS
Documentation
name: Build

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        rust: [stable, nightly]
        os: [ubuntu-24.04, windows-2025, macos-14]
        type: [Release, Debug]

    steps:
    - uses: actions/checkout@v2

    - name: Install Rust
      run: |
        rustup toolchain install ${{ matrix.rust }} --profile minimal
        rustup component add rustfmt --toolchain ${{ matrix.rust }}
        rustup component add clippy --toolchain ${{ matrix.rust }}

    - name: Install Rust (Android target)
      run: rustup target add x86_64-linux-android --toolchain ${{ matrix.rust }}
      if: matrix.os == 'ubuntu-24.04'

    - name: Install Dependencies (Linux)
      run: sudo apt-get update && sudo apt-get install libpulse-dev pulseaudio libdbus-1-dev
      if: matrix.os == 'ubuntu-24.04'

    - name: Check format
      shell: bash
      run: rustup run ${{ matrix.rust }} cargo fmt -- --check

    - name: Clippy
      shell: bash
      run: rustup run ${{ matrix.rust }} cargo clippy -- -D warnings

    - name: Build
      shell: bash
      run: rustup run ${{ matrix.rust }} cargo build --all

    - name: Build (Android)
      shell: bash
      run: rustup run ${{ matrix.rust }} cargo build --target x86_64-linux-android --all
      if: matrix.os == 'ubuntu-24.04'

    - name: Test
      shell: bash
      run: rustup run ${{ matrix.rust }} cargo test --all
      # setrlimit64 error in the CI container
      if: matrix.os != 'ubuntu-24.04'

  # Test on Linux, as if it didn't have DBUS, to exercise the fallback path.
  build-fallback:
    runs-on: ubuntu-24.04
    strategy:
      matrix:
        rust: [stable, nightly]

    steps:
    - uses: actions/checkout@v2

    - name: Install Rust
      run: |
        rustup toolchain install ${{ matrix.rust }} --profile minimal
        rustup component add rustfmt --toolchain ${{ matrix.rust }}
        rustup component add clippy --toolchain ${{ matrix.rust }}

    - name: Check format
      shell: bash
      run: rustup run ${{ matrix.rust }} cargo fmt -- --check

    - name: Clippy
      shell: bash
      run: rustup run ${{ matrix.rust }} cargo clippy --no-default-features -- -D warnings

    - name: Build fallback (Linux without dbus)
      shell: bash
      run: rustup run ${{ matrix.rust }} cargo build --no-default-features

    - name: Test fallback (Linux without dbus)
      shell: bash
      run: rustup run ${{ matrix.rust }} cargo test --no-default-features