Files
ssw-mpc/tools/ci.sh
T
admin 54781b3f83
ci / gate (push) Waiting to run
refactor: 项目改名 ssw-mpc,crate 统一到 mpc-* 前缀
- 项目与文档标题:nax-rs → ssw-mpc(尚数网-多方安全计算),二进制 nax → mpc
- 18 个 crate 及目录 nax-* → mpc-*,Rust 引用 nax_* → mpc_*
- 环境变量、C 符号、构建/部署脚本:NAX_* → MPC_*、libnax_ray.so → libmpc_ray.so
- 保留协议域分隔常量与 refs/nax 参考实现路径,维持 golden 向量与历史数据兼容
- 新增 [profile.dev] incremental=false
2026-11-05 15:06:12 +08:00

46 lines
1.5 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
#
# 回归闸门:CI 与本地跑的是**同一份**,避免「CI 挂了、本地不知道怎么复现」。
#
# 守的三条就是 CLAUDE.md 里的铁律,不多不少:
# 1. 全量测试必须带 --features secure(不带会漏掉 36 条,其中曾有坏的)
# 2. 零 rustc 告警(-Dwarnings,warning 直接变 error)
# 3. mpc-core 必须能 no_std 编译(TEE / armv7 那条路)
#
# 用法:tools/ci.sh 正常跑
# tools/ci.sh --fast 跳过测试,只编译(改完想快速确认能编过时用)
#
set -euo pipefail
cd "$(dirname "$0")/.."
FAST=0
for a in "$@"; do
case "$a" in
--fast) FAST=1 ;;
-h|--help) sed -n '2,12p' "$0"; exit 0 ;;
*) echo "不认识的参数: $a" >&2; exit 2 ;;
esac
done
step() { printf '\n\033[1m== %s ==\033[0m\n' "$1"; }
ok() { printf '\033[32m ok\033[0m\n'; }
if [ "$FAST" -eq 0 ]; then
step "1/3 全量测试(含 secure 特性)"
cargo test --workspace --features secure
ok
fi
step "2/3 零告警构建(所有目标)"
# -Dwarnings 同时作用于本地 crate 的 test / bench / example 目标,
# 所以「测试代码里有 unused」也会被拦下 —— 这正是想要的。
RUSTFLAGS="${RUSTFLAGS:+${RUSTFLAGS} }-Dwarnings" \
cargo build --workspace --all-targets --features secure
ok
step "3/3 mpc-core no_std 守线"
cargo build -p mpc-core --no-default-features
ok
printf '\n\033[32m\033[1m全部通过\033[0m\n'