guanghu/.chunk/run-rust-gate.sh
冰朔 8739805f99
Some checks failed
Auto-update PR branches / Update open PR branches (push) Has been cancelled
CI / Frontend Static Quality Checks (push) Has been cancelled
CI / Frontend Tests & Coverage (push) Has been cancelled
CI / Rust Tests & Quality Checks (push) Has been cancelled
CI / Linux build verification (push) Has been cancelled
Release (Alpha) / Compute alpha version (push) Has been cancelled
Release (Alpha) / Build release artifacts (push) Has been cancelled
Release (Alpha) / GitHub Release (alpha) (push) Has been cancelled
Release (Alpha) / Update docs and release pages (push) Has been cancelled
Deploy docs / Build VitePress site (push) Has been cancelled
Deploy docs / Deploy to GitHub Pages (push) Has been cancelled
光湖开源源码快照 · Tolaria AGPL 分叉基线 · 独立更新链
2026-07-05 17:45:16 +08:00

31 lines
770 B
Bash

#!/usr/bin/env bash
set -euo pipefail
start_time=$(date +%s)
log_rust() {
printf '[sidecar-rust +%ss] %s\n' "$(($(date +%s) - start_time))" "$*"
}
mkdir -p "$HOME/Documents"
# shellcheck disable=SC1091
. "$HOME/.cargo/env"
export CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-2}"
log_rust 'clippy started'
cargo clippy --manifest-path=src-tauri/Cargo.toml -- -D warnings
log_rust 'clippy passed'
log_rust 'rustfmt started'
cargo fmt --manifest-path=src-tauri/Cargo.toml -- --check
log_rust 'rustfmt passed'
log_rust 'coverage started'
cargo llvm-cov \
--manifest-path src-tauri/Cargo.toml \
--no-clean \
--ignore-filename-regex "lib\\.rs|main\\.rs|menu\\.rs" \
--fail-under-lines 85 \
-- --test-threads=1
log_rust "completed in $(($(date +%s) - start_time))s"