Repository navigation
fix(lint): resolve clippy duplicate import errors in test files #107
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust CI (build, lint, test) | |
| on: | |
| push: | |
| branches: [ stage, main ] | |
| pull_request: | |
| branches: [ stage, main ] | |
| workflow_dispatch: | |
| inputs: | |
| run_integration: | |
| description: 'Run PipeWire integration tests (requires suitable runner)' | |
| required: false | |
| default: 'false' | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies (GTK, ALSA, PipeWire, WirePlumber) | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y \ | |
| build-essential pkg-config \ | |
| libglib2.0-dev libgtk-3-dev \ | |
| libasound2-dev \ | |
| libpipewire-0.3-dev \ | |
| pipewire wireplumber \ | |
| xvfb # Virtual framebuffer for GTK tests | |
| - name: Set up Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| override: true | |
| - name: Cache Cargo and target | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: cargo fmt check | |
| run: cargo fmt --all -- --check | |
| - name: cargo clippy (warn only) | |
| run: cargo clippy --all-targets --all-features | |
| - name: Build (check compilation) | |
| run: cargo build --workspace --all-features | |
| - name: Run unit tests (no GTK/display needed) | |
| env: | |
| CI: "true" | |
| GITHUB_ACTIONS: "true" | |
| run: cargo test --workspace --all-features --verbose -- --test-threads=1 | |
| - name: Run GTK tests with virtual display | |
| env: | |
| CI: "true" | |
| GITHUB_ACTIONS: "true" | |
| DISPLAY: ":99.0" | |
| RUN_PIPEWIRE_INTEGRATION: ${{ github.event.inputs.run_integration || 'false' }} | |
| run: | | |
| # Start Xvfb virtual display | |
| Xvfb :99 -screen 0 1280x1024x24 & | |
| sleep 2 | |
| # Run tests with virtual display | |
| cargo test --workspace --all-features --verbose -- --test-threads=1 | |
| # Clean up Xvfb | |
| killall Xvfb || true |