From e98cb78e4d9dcf1af785fb1e895ae2b126df50f0 Mon Sep 17 00:00:00 2001 From: aRustyDev <36318507+aRustyDev@users.noreply.github.com> Date: Thu, 29 Oct 2026 21:14:52 -0400 Subject: [PATCH 1/2] ci: test existing features on Linux Windows and macOS --- .github/workflows/tests.yml | 49 +++++++++++++++++++++++-------------- src/scrapers.rs | 4 +-- src/tests/ui.rs | 13 +++++++--- src/ui/init.rs | 2 +- src/ui/media_controls.rs | 10 +++----- 5 files changed, 47 insertions(+), 31 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bc2d22a..7399514 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,27 +1,40 @@ -name: Rust Unit Tests +name: Tests on: workflow_dispatch: push: - branches: - - '**' - + branches: ['**'] pull_request: - branches: - - '**' + branches: ['**'] jobs: - test: - runs-on: ubuntu-latest + native: + name: Tests (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + features: mpris,scrape,extra-audio-formats + - os: windows-latest + features: media-controls,scrape,extra-audio-formats + - os: macos-latest + features: scrape,extra-audio-formats steps: - - name: Checkout code - uses: actions/checkout@v5 - - - name: Install dependencies - run: sudo apt install libasound2-dev - - - name: Setup rust + - uses: actions/checkout@v5 + - name: Install ALSA development headers + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y libasound2-dev + - name: Set up Rust uses: actions-rust-lang/setup-rust-toolchain@v1 - - - name: Run tests - run: cargo test --all --verbose + - name: Check formatting + run: cargo fmt --check + - name: Run standard tests + run: cargo test --locked + - name: Run tests without default features + run: cargo test --locked --no-default-features + - name: Run native feature tests + run: cargo test --locked --features ${{ matrix.features }} + - name: Check native features without default features + run: cargo check --locked --all-targets --no-default-features --features ${{ matrix.features }} diff --git a/src/scrapers.rs b/src/scrapers.rs index 0e28f5e..7708939 100644 --- a/src/scrapers.rs +++ b/src/scrapers.rs @@ -75,11 +75,11 @@ async fn get(client: &Client, path: &str, source: Source) -> eyre::Result Date: Thu, 29 Oct 2026 23:13:31 -0400 Subject: [PATCH 2/2] docs(ci): explain native coverage and Windows rendering --- .github/workflows/tests.yml | 2 ++ src/tests/ui.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7399514..c66100c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,6 +14,8 @@ jobs: strategy: fail-fast: false matrix: + # Test platform adapters on their native OS; an all-features build + # cannot exercise both the Linux and Windows integrations. include: - os: ubuntu-latest features: mpris,scrape,extra-audio-formats diff --git a/src/tests/ui.rs b/src/tests/ui.rs index 566bd10..c43e367 100644 --- a/src/tests/ui.rs +++ b/src/tests/ui.rs @@ -87,8 +87,8 @@ mod window { format!("┌{MIDDLE}┐\n{}\n└{MIDDLE}┘", sided("abc")).trim_end(), render.trim_end() ); - // Crossterm's Windows backend includes the final terminal row while - // its Unix backend does not; both renderings contain three lines. + // Lowfi's renderer adds a final row on Windows to avoid repeatedly + // writing to the terminal's last line; the visible content is identical. assert_eq!(height, if cfg!(windows) { 4 } else { 3 }); }