mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 16:02:24 +00:00
The release workflow is a plain checkout of the tag — nothing rewrites Cargo.toml there, so the lockfile guard the CI build just gained applies just as well, and a release is the build you least want silently re-resolving dependencies. Only nightly stays unlocked: it stamps Cargo.toml's version, which makes the lock's own root entry stale by design.
77 lines
2.8 KiB
YAML
77 lines
2.8 KiB
YAML
name: CI
|
|
|
|
# Compile + test on every push/PR. The Windows and Linux jobs are the
|
|
# compile-feedback loop for the platform-specific code a macOS dev machine
|
|
# never builds (`cfg(windows)` transport / process detach / config dir,
|
|
# the Linux `/proc` queries, the x11/wayland gpui backends). The macOS job
|
|
# guards against regressing the original target.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
fmt:
|
|
name: rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- run: cargo fmt --check
|
|
|
|
build:
|
|
name: build & test (${{ matrix.target }})
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- runner: macos-14
|
|
target: aarch64-apple-darwin
|
|
- runner: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
- runner: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- name: Checkout tty7
|
|
uses: actions/checkout@v4
|
|
|
|
# gpui-component is a git dependency (see Cargo.toml), so no sibling
|
|
# checkout is needed. The Windows backend (gpui_windows + DirectWrite/D3D)
|
|
# ships with the windows-latest runner's SDK — no extra system deps.
|
|
|
|
# gpui's Linux backends need the x11/wayland/xkb/font dev packages at
|
|
# build time (build scripts resolve them via pkg-config). Same set the
|
|
# README documents for building from source on Linux.
|
|
- name: Install Linux system dependencies
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y pkg-config cmake clang libxkbcommon-dev \
|
|
libxkbcommon-x11-dev libfontconfig1-dev libfreetype6-dev \
|
|
libwayland-dev libx11-dev libxcb1-dev libzstd-dev libssl-dev \
|
|
libkrb5-dev
|
|
echo "LIBGSSAPI_IMPL=mit" >> "$GITHUB_ENV"
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
# `--locked` on the build so a Cargo.lock that disagrees with Cargo.toml
|
|
# fails here instead of being silently rewritten. Without it the drift is
|
|
# invisible to CI and lands on contributors instead: every local `cargo`
|
|
# run rewrites the lock, leaving a permanently dirty working tree that has
|
|
# to be re-discarded before every commit. The release workflow locks its
|
|
# build too; only nightly stays unlocked, because it stamps Cargo.toml's
|
|
# version and relies on cargo refreshing the lock's own root entry.
|
|
- name: Build
|
|
run: cargo build --locked --target ${{ matrix.target }}
|
|
|
|
- name: Test
|
|
run: cargo test --locked --target ${{ matrix.target }}
|