-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_local_ci.sh
More file actions
executable file
·48 lines (40 loc) · 1.51 KB
/
run_local_ci.sh
File metadata and controls
executable file
·48 lines (40 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -euo pipefail
# 本地一键 CI(模拟 ci-pr)。
# 执行顺序:
# 先跑 full 单元矩阵(8 组),再跑 quick fuzz(1 组默认语义)。
# 默认参数与 ci-pr.yml 对齐:
# unit: UNIT_MODE=full, UNIT_SKIP_COV=1
# fuzz: FUZZ_MODE=quick, FUZZ_SKIP_COV=1, FUZZ_MAX_TOTAL_TIME=45, workers/jobs=2
# fuzz 阶段参数可用同名环境变量临时覆盖。
scriptDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=scripts/lib/common.sh
source "${scriptDir}/scripts/lib/common.sh"
repoRoot="$(ryanjson_repo_root_from_source "${BASH_SOURCE[0]}" 0)"
cd "${repoRoot}"
main() {
ryanjson_print_banner_begin "本地 CI 启动:阶段 1/2 -> Base 单元测试"
ryanjson_print_banner_end
bash ./run_local_base.sh
ryanjson_print_banner_begin "本地 CI 启动:阶段 2/2 -> Fuzz quick"
ryanjson_print_banner_end
: "${RYANJSON_STRICT_OBJECT_KEY_CHECK:=false}"
: "${RYANJSON_DEFAULT_ADD_AT_HEAD:=true}"
: "${RYANJSON_SNPRINTF_SUPPORT_SCIENTIFIC:=true}"
: "${FUZZ_MODE:=quick}"
: "${FUZZ_SKIP_COV:=1}"
: "${FUZZ_RUNS:=}"
: "${FUZZ_MAX_TOTAL_TIME:=45}"
: "${FUZZ_WORKERS:=2}"
: "${FUZZ_JOBS:=2}"
: "${XMAKE_FORCE_CLEAN:=0}"
export RYANJSON_STRICT_OBJECT_KEY_CHECK
export RYANJSON_DEFAULT_ADD_AT_HEAD
export RYANJSON_SNPRINTF_SUPPORT_SCIENTIFIC
export FUZZ_MODE FUZZ_SKIP_COV FUZZ_RUNS FUZZ_MAX_TOTAL_TIME FUZZ_WORKERS FUZZ_JOBS
export XMAKE_FORCE_CLEAN
bash ./run_local_fuzz.sh
ryanjson_print_banner_begin "本地 CI 执行完成"
ryanjson_print_banner_end
}
main "$@"