name: CI on: push: branches: [main, master] pull_request: workflow_dispatch: 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 test: name: test (${{ matrix.os }}) strategy: fail-fast: false matrix: os: [ubuntu-24.04, windows-2025] runs-on: ${{ matrix.os }} 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 # Under Xvfb, so X11 tests (screen capture, global hotkeys through # XTEST input) run instead of skipping. - name: Test (Linux, Xvfb) if: runner.os == 'Linux' run: xvfb-run -a bash -c 'TSC_X11_TEST_DISPLAY="$DISPLAY" cargo test --workspace --locked' - name: Test if: runner.os != 'Linux' run: cargo test --workspace --locked release-build: name: release build (${{ matrix.os }}) strategy: fail-fast: false matrix: include: - os: ubuntu-24.04 artifact: tsc-desktop-linux-x86_64 - os: windows-2025 artifact: tsc-desktop-windows-x86_64 runs-on: ${{ matrix.os }} 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 with: key: release - name: Build tsc-desktop run: cargo build --release --locked -p tsc-ui - name: Stage (Linux) if: runner.os == 'Linux' run: | mkdir -p dist cp target/release/tsc-desktop dist/ cp packaging/linux/* THIRD_PARTY_NOTICES.md dist/ # The installer is built when NSIS is on the runner; unsigned. - name: Stage (Windows) if: runner.os == 'Windows' shell: pwsh run: | New-Item -ItemType Directory -Force dist | Out-Null Copy-Item target\release\tsc-desktop.exe, THIRD_PARTY_NOTICES.md dist\ $makensis = (Get-Command makensis -ErrorAction SilentlyContinue).Source if (-not $makensis) { $makensis = "${env:ProgramFiles(x86)}\NSIS\makensis.exe" } if (Test-Path $makensis) { $version = (cargo metadata --no-deps --format-version 1 | ConvertFrom-Json).packages | Where-Object name -eq 'tsc-ui' | Select-Object -ExpandProperty version & $makensis "/DVERSION=$version" "/DOUTDIR=$PWD\dist" packaging\windows\installer.nsi if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } } else { Write-Host "::notice::NSIS not found, uploading the executable only" } - uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact }} path: dist/ if-no-files-found: error # The Android app (docs/android.md): clippy on the Android-only code and a # debug APK for arm64. Nothing runs on a device here. android: name: android (arm64 APK) runs-on: ubuntu-24.04 timeout-minutes: 60 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" "build-tools;36.0.0" > /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 tsc-android --no-deps -- -D warnings cargo ndk -t arm64-v8a --platform 29 clippy --locked -p tsc-media --no-default-features --no-deps -- -D warnings - name: Debug APK working-directory: android run: ./gradlew --no-daemon assembleDebug -Ptsc.abis=arm64-v8a - uses: actions/upload-artifact@v4 with: name: tsc-android-debug-arm64 path: android/app/build/outputs/apk/debug/*.apk if-no-files-found: error # 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 # tsctl, the gateway, the engine and tsc-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 (tsc-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: TSC_INTEROP=1 cargo test --locked -p tsc-stream --test browser_interop -- --nocapture