- notices: scripts/notices.sh --check with the pinned cargo-about fails when THIRD_PARTY_NOTICES.md does not match Cargo.lock. - browser-interop: TSC_INTEROP=1 tsc-stream browser_interop test against headless Chromium (Playwright 1.56.1); continue-on-error, since it depends on a browser download. - smoke: timeout, and the logs in dev/.state are uploaded on failure. - audit.yml: cargo-deny advisories every day, not only on pushes. - Release artifacts, the Flatpak and the NSIS installer include THIRD_PARTY_NOTICES.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
208 lines
7.4 KiB
YAML
208 lines
7.4 KiB
YAML
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
|
|
|
|
# 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
|