name: CI # Fast checks on every push to main and every PR: lint, tests, license and # advisory checks, and the integration tests against TS3/TS6 servers. # Packages are built only by release.yml (tags, or by hand), which also runs # these checks through workflow_call. # Changes to documentation only need no build (same list twice: no YAML # anchors in workflows). THIRD_PARTY_NOTICES.md is compiled into the app # (About page) and checked below. on: push: branches: [main, master] paths: - "**" - "!docs/**" - "!**/*.md" - "THIRD_PARTY_NOTICES.md" pull_request: paths: - "**" - "!docs/**" - "!**/*.md" - "THIRD_PARTY_NOTICES.md" workflow_dispatch: workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CARGO_TERM_COLOR: always RUST_BACKTRACE: "0" jobs: lint: name: fmt + clippy runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/system-deps - name: Install toolchain (rust-toolchain.toml) run: rustup toolchain install - uses: Swatinem/rust-cache@v2 # The vendored crates in crates/proto use upstream's nightly rustfmt config # and have known clippy findings (cleanup is milestone M1), so the strict # checks cover our own crates only. - name: rustfmt (own crates) run: cargo fmt $(scripts/own-crates.sh) --check - name: clippy (own crates, deny warnings) run: cargo clippy $(scripts/own-crates.sh) --all-targets --no-deps -- -D warnings - name: clippy (workspace, report only) run: cargo clippy --workspace --all-targets # Under Xvfb, so X11 tests (screen capture, global hotkeys through XTEST # input) run instead of skipping. Windows tests run in release.yml. test: name: test (Linux) runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/system-deps - name: Install toolchain (rust-toolchain.toml) run: rustup toolchain install - uses: Swatinem/rust-cache@v2 - name: Build run: cargo build --workspace --all-targets --locked - name: Test run: xvfb-run -a bash -c 'VOELIN_X11_TEST_DISPLAY="$DISPLAY" cargo test --workspace --locked' # Windows-only code compiles and is lint-clean (MSVC, libvpx from vcpkg). clippy-windows: name: clippy (Windows) runs-on: windows-2025 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/system-deps - name: Install toolchain (rust-toolchain.toml) run: rustup toolchain install - uses: Swatinem/rust-cache@v2 - name: clippy (own crates, deny warnings) shell: bash run: cargo clippy $(scripts/own-crates.sh) --all-targets --no-deps --locked -- -D warnings # The Android-only code (docs/android.md), for the Android target. The APKs # are built by release.yml. clippy-android: name: clippy (Android) runs-on: ubuntu-24.04 timeout-minutes: 45 env: NDK_VERSION: 27.3.13750724 steps: - uses: actions/checkout@v4 - name: Install toolchain (rust-toolchain.toml) run: | rustup toolchain install rustup target add aarch64-linux-android - uses: Swatinem/rust-cache@v2 with: key: android - uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - name: Android SDK packages run: | yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses > /dev/null "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" \ "ndk;$NDK_VERSION" "platforms;android-36" > /dev/null echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/$NDK_VERSION" >> "$GITHUB_ENV" # CMake (libopus) and Slint's Java helper. echo "ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/$NDK_VERSION" >> "$GITHUB_ENV" echo "ANDROID_JAR=$ANDROID_HOME/platforms/android-36/android.jar" >> "$GITHUB_ENV" - name: Install cargo-ndk run: cargo install cargo-ndk --locked --version 4.1.2 - name: clippy (Android target, deny warnings) run: | cargo ndk -t arm64-v8a --platform 29 clippy --locked -p voelin-android -p voelin-ui --no-deps -- -D warnings cargo ndk -t arm64-v8a --platform 29 clippy --locked -p voelin-media --no-default-features --no-deps -- -D warnings # Licenses, bans, sources and RustSec advisories (the `cargo audit` # database); audit.yml repeats the advisories check daily. deny: name: cargo-deny runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 # Default features only: the optional `rug` puzzle backend (GMP, LGPL) is # benchmark-only and never shipped. - uses: EmbarkStudios/cargo-deny-action@v2 with: arguments: --workspace # THIRD_PARTY_NOTICES.md (shown in the About page) must match Cargo.lock. # cargo-about's output is independent of the host (the graph is filtered # by the targets in about.toml), so the committed file is compared exactly. notices: name: third-party notices runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - name: Install toolchain (rust-toolchain.toml) run: rustup toolchain install # Caches ~/.cargo/bin too, so cargo-about is built once. - uses: Swatinem/rust-cache@v2 with: key: notices - name: Install cargo-about run: cargo install cargo-about --locked --version 0.9.2 --features cli - name: Check THIRD_PARTY_NOTICES.md run: scripts/notices.sh --check # voelinctl, the gateway, the engine and voelin-stream against real TS3 and TS6 # servers, including a synthetic VP8 + Opus stream through the TS6 server # (scripts/it-smoke.sh). smoke: name: integration smoke (TS3 + TS6) runs-on: ubuntu-24.04 needs: test timeout-minutes: 45 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/system-deps - name: Install toolchain (rust-toolchain.toml) run: rustup toolchain install - uses: Swatinem/rust-cache@v2 - name: Start TeamSpeak servers run: docker compose -f dev/docker-compose.yml up -d - name: Smoke test run: scripts/it-smoke.sh - name: Server logs if: failure() run: docker compose -f dev/docker-compose.yml logs --no-color # Client, gateway and stream logs the script keeps in dev/.state. - name: Upload smoke logs if: failure() uses: actions/upload-artifact@v4 with: name: smoke-logs path: dev/.state/*.log if-no-files-found: ignore # Our WebRTC peers against Chromium's (libwebrtc, as in the official TS6 # client); see tests/interop/README.md. Informational: a failure is # reported on the job but does not fail the workflow, since it depends on # a browser download and the runner's network interfaces. browser-interop: name: browser interop (voelin-stream, Chromium) runs-on: ubuntu-24.04 needs: test continue-on-error: true timeout-minutes: 30 env: PLAYWRIGHT_VERSION: 1.56.1 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/system-deps - name: Install toolchain (rust-toolchain.toml) run: rustup toolchain install - uses: Swatinem/rust-cache@v2 - uses: actions/setup-node@v4 with: node-version: 22 - name: Cache Playwright browsers uses: actions/cache@v4 with: path: ~/.cache/ms-playwright key: playwright-${{ env.PLAYWRIGHT_VERSION }}-chromium # Global install: the test finds Playwright through `npm root -g`. - name: Install Playwright and Chromium run: | npm install -g "playwright@$PLAYWRIGHT_VERSION" playwright install --with-deps chromium - name: Browser interop test run: VOELIN_INTEROP=1 cargo test --locked -p voelin-stream --test browser_interop -- --nocapture