Files
lucisv/.gitea/workflows/ci.yml
T

73 lines
3.0 KiB
YAML

# Author: Guoliang Chen, a Senior Digital Design Engineer
# CI: author-stamp check plus the three checks CLAUDE.md requires before any
# work is finished (with `cargo test` run under `tools/guard.sh`), plus the
# extension's JavaScript tests and the corpus gate, enforced on every push. Runs on the self-hosted macOS runner in host mode (no
# containers), so the toolchain is the same one releases are built with —
# and, since 0.65.9, the same checks on Linux (the `linux` job below), where
# the released Linux binaries had never been compiled-and-tested before.
name: ci
on:
push:
branches: [master]
pull_request:
jobs:
checks:
runs-on: macos-arm64
steps:
- uses: actions/checkout@v4
- name: author stamps
run: python3 tools/stamp_author.py --check
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: cargo test
run: tools/guard.sh -m 8 -t 1800 -- cargo test --workspace
# The VS Code extension's headless checks (a stubbed `vscode`, no npm
# dependencies): node >= 18 for `--test`; the runner has node 22.
- name: extension tests
run: node --test editors/vscode/*_test.js
# The 99.1% headline, enforced: score the 820-file corpus and fail on any
# regression below scripts/corpus-baseline (verification errors and
# crashes fail outright). The corpus is pinned-rev clones (not in the
# repo), cached on the runner host and fetched once on a cache miss.
corpus:
runs-on: macos-arm64
steps:
- uses: actions/checkout@v4
- name: Ensure the cached corpus
run: |
corpus="$HOME/.cache/lucisv-corpus"
[ -d "$corpus" ] || tools/corpus_fetch.sh "$corpus"
echo "CORPUS=$corpus" >> "$GITHUB_ENV"
- name: Build the release binary the scorer drives
run: cargo build --release -p lucisv
- name: Score and gate
run: scripts/corpus_gate.sh "$CORPUS"
# The suite on Linux x86-64: the luhpe-linux-x64 runner starts each job in
# the runner image (as root, 4 CPUs / 8 GB for the whole runner), with no
# Rust in it, so the toolchain is installed per job and the build is cold
# (a few minutes). Clippy is here as well as on macOS because code behind
# cfg(unix)/cfg(target_os) is only compiled on the platform it names: the
# first Linux trial failed clippy on imports macOS never saw. To run the
# same thing from a working tree without a push: tools/linux_check.sh.
linux:
runs-on: linux-x64
steps:
- uses: actions/checkout@v4
- name: Install the Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --profile minimal -c clippy,rustfmt
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: cargo test
run: tools/guard.sh -m 6 -t 1800 -- cargo test --workspace
# Author: Guoliang Chen. Lucisv is made by Guoliang Chen with love, luciochen.com