Skip to content

Feature/ubuntu

Feature/ubuntu #24

Workflow file for this run

name: CI
# Build + test + fmt/clippy gate on every push and PR to ALL branches, across the
# Windows / macOS / Linux platforms the launcher targets, so no merge lands without
# a green cross-platform build + passing tests. See issue #9.
on:
pull_request:
branches: ['**']
# Cancel superseded in-flight runs for the same ref. Matters more here than for a
# single-OS gate: every run spins up three OS legs.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Least privilege: the gate only needs to read the repo.
permissions:
contents: read
# Every job uses actions-rust-lang/setup-rust-toolchain@v1, which installs the
# toolchain pinned in rust-toolchain.toml (1.95.0 + rustfmt/clippy) because no
# `toolchain:` input is given, and caches the cargo registry + target/ per OS.
# `rustflags: ""` neutralizes that action's default RUSTFLAGS=-D warnings so
# ordinary build/test warnings don't fail the build; deny-warnings is enforced
# ONLY in the clippy job via the explicit `-- -D warnings`.
#
# fmt and clippy run once on Linux; build + test run on all three OSes. The jobs
# are independent (no `needs:`) so all signals surface even when one fails.
jobs:
fmt:
name: fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
cache: false # fmt does not compile, so there is nothing to cache
- run: cargo fmt --all --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
# clippy type-checks the GUI/WebView code, so it needs the same Linux system
# libraries the build does (wry/eframe link against GTK3 / WebKit2GTK / X11).
- name: Install Linux GUI/WebView system deps
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev libsoup-3.0-dev \
libgtk-3-dev libxdo-dev libayatana-appindicator3-dev librsvg2-dev \
libgl1-mesa-dev libxkbcommon-dev libwayland-dev \
libxcursor-dev libxrandr-dev libxi-dev
- run: cargo clippy --all-targets -- -D warnings
build-test:
name: build-test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
# Linux is the only platform needing system libraries: wry/eframe link against
# GTK3 / WebKit2GTK / X11 / wayland / GL. Windows and macOS build the WebView
# against their OS-native frameworks (WebView2 / WKWebView) with no extra install.
- name: Install Linux GUI/WebView system deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev libsoup-3.0-dev \
libgtk-3-dev libxdo-dev libayatana-appindicator3-dev librsvg2-dev \
libgl1-mesa-dev libxkbcommon-dev libwayland-dev \
libxcursor-dev libxrandr-dev libxi-dev
# --locked fails if Cargo.lock is stale or missing (Cargo.lock is committed).
- run: cargo build --all-targets --locked
- run: cargo test --locked