diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 769c4d2..070958c 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -19,6 +19,10 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install build tools and ALSA dependencies + run: | + sudo apt-get update && sudo apt-get install -y build-essential libasound2-dev pkg-config; + - name: Install Rust stable run: rustup install stable diff --git a/.github/workflows/cross-compile.yml b/.github/workflows/cross-compile.yml index 98083ed..8744608 100644 --- a/.github/workflows/cross-compile.yml +++ b/.github/workflows/cross-compile.yml @@ -13,45 +13,58 @@ on: - '**/docs/**' jobs: - build: + cross-compile: runs-on: ${{ matrix.os }} + strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, x86_64-apple-darwin, x86_64-pc-windows-msvc] + target: + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - armv7-unknown-linux-gnueabihf + - x86_64-apple-darwin + - x86_64-pc-windows-msvc + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + - os: ubuntu-latest + target: armv7-unknown-linux-gnueabihf + - os: macos-latest + target: x86_64-apple-darwin + - os: windows-latest + target: x86_64-pc-windows-msvc steps: - uses: actions/checkout@v4 - - name: Cache Cargo registry on ${{ matrix.os }} (${{ matrix.target }}) - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-registry- - - - name: Cache Cargo build on ${{ matrix.os }} (${{ matrix.target }}) - uses: actions/cache@v3 - with: - path: target - key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.target }} - restore-keys: | - ${{ runner.os }}-cargo-build-${{ matrix.target }} + - name: Install build tools and ALSA dependencies (Linux only) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update && sudo apt-get install -y build-essential libasound2-dev pkg-config; - - name: Install Rust stable on ${{ matrix.os }} - run: rustup install stable + - name: Install C compiler (macOS) + if: matrix.os == 'macos-latest' + run: | + xcode-select --install || echo "Xcode already installed"; + + - name: Install Visual Studio Build Tools (Windows) + if: matrix.os == 'windows-latest' + run: | + choco install visualstudio2022-workload-vctools --yes - - name: Add cross-compilation target ${{ matrix.target }} on ${{ matrix.os }} - run: rustup target add ${{ matrix.target }} + - name: Install Rust stable + run: rustup install stable - - name: Build ${{ matrix.target }} on ${{ matrix.os }} - run: cargo build --verbose --target ${{ matrix.target }} + - name: Cross-compile for ${{ matrix.target }} on Rust stable + run: | + rustup target add ${{ matrix.target }} + cargo build --release --verbose --target ${{ matrix.target }} - - name: Upload binaries for ${{ matrix.target }} on ${{ matrix.os }} + - name: Upload compiled binaries uses: actions/upload-artifact@v3 with: - name: my-binary-${{ matrix.target }}-stable - path: target/${{ matrix.target }}/debug/ + name: binaries-${{ matrix.target }} + path: target/${{ matrix.target }}/release/ diff --git a/.github/workflows/periodic.yml b/.github/workflows/periodic.yml index d4f742b..46a0ff1 100644 --- a/.github/workflows/periodic.yml +++ b/.github/workflows/periodic.yml @@ -3,56 +3,67 @@ name: Check on Rust beta and dependency health on: schedule: - cron: '0 0 * * 0' # Runs every Sunday at midnight + workflow_dispatch: jobs: - security-audit: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Install Rust stable for security audit - run: rustup install stable - - - name: Run security audit - run: cargo install cargo-audit && cargo audit + maintenance: + runs-on: ${{ matrix.os }} - unused-dependencies: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + target: + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - armv7-unknown-linux-gnueabihf + - x86_64-apple-darwin + - x86_64-pc-windows-msvc + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + - os: ubuntu-latest + target: armv7-unknown-linux-gnueabihf + - os: macos-latest + target: x86_64-apple-darwin + - os: windows-latest + target: x86_64-pc-windows-msvc steps: - uses: actions/checkout@v4 - - name: Install Rust nightly and udeps for unused dependency check + - name: Install build tools and ALSA dependencies (Linux only) + if: matrix.os == 'ubuntu-latest' run: | - rustup install nightly - rustup component add rustc-dev llvm-tools-preview --toolchain nightly - cargo +nightly install cargo-udeps - - - name: Check for unused dependencies - run: cargo +nightly udeps --all-targets + sudo apt-get update && sudo apt-get install -y build-essential libasound2-dev pkg-config; - beta-cross-compilation: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, x86_64-apple-darwin, x86_64-pc-windows-msvc] + - name: Install C compiler (macOS) + if: matrix.os == 'macos-latest' + run: | + xcode-select --install || echo "Xcode already installed"; - steps: - - uses: actions/checkout@v4 + - name: Install Visual Studio Build Tools (Windows) + if: matrix.os == 'windows-latest' + run: | + choco install visualstudio2022-workload-vctools --yes - - name: Install Rust beta on ${{ matrix.os }} + - name: Install Rust beta run: rustup install beta - - name: Add cross-compilation target ${{ matrix.target }} on ${{ matrix.os }} - run: rustup target add ${{ matrix.target }} + - name: Security audit + run: cargo audit - - name: Build ${{ matrix.target }} on ${{ matrix.os }} (beta) - run: cargo build --verbose --target ${{ matrix.target }} + - name: Check for unused dependencies + run: cargo +nightly udeps + + - name: Cross-compile for ${{ matrix.target }} on Rust beta + run: | + rustup target add ${{ matrix.target }} + cargo build --release --verbose --target ${{ matrix.target }} - - name: Upload binaries for ${{ matrix.target }} on ${{ matrix.os }} (beta) + - name: Upload compiled binaries uses: actions/upload-artifact@v3 with: - name: my-binary-${{ matrix.target }}-beta - path: target/${{ matrix.target }}/debug/ + name: binaries-${{ matrix.target }} + path: target/${{ matrix.target }}/release/