Files
VoelinClient/.github/workflows/ci.yml
T
Claude e28d7cca03 CI: fast checks only; packages are built by a release workflow
ci.yml (pushes to main, PRs) now runs only the quick checks: fmt +
clippy, the Linux tests (Xvfb), clippy for Windows (MSVC) and for
Android, cargo-deny, the notices check, and the TS3/TS6 smoke and
browser interop tests. It skips documentation-only changes (except
THIRD_PARTY_NOTICES.md, which is compiled in) and can be called by
other workflows.

The new release.yml builds the packages: on a v* tag it runs the same
checks (through ci.yml) plus the Windows tests and every package job
(Linux .tar.gz/.deb for the app and tsgw, Windows zip + installer,
Flatpak, Android APKs, the tsgw image) and attaches them with
SHA256SUMS to a draft release; run by hand it only uploads the
packages as artifacts. docker.yml runs on tags and by hand instead of
on PRs, pushes and weekly.

scripts/own-crates.sh also recognizes crates/proto with Windows path
separators, so Windows clippy covers our crates only (checked locally
with clippy for x86_64-pc-windows-gnu: clean). Docs follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-26 22:14:25 +00:00

218 lines
7.9 KiB
YAML

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