From e8d95ac1b336a159ec2da7a45b44be33a1502baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=A8=E6=88=B7CI=20Test?= Date: Sat, 11 Jul 2026 21:40:01 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E8=A6=86=E7=9B=96=E7=8E=87=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E8=84=9A=E6=9C=AC=E6=94=AF=E6=8C=81=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E9=97=A8=E6=A7=9B=EF=BC=8C=E9=9B=86=E6=88=90?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=BE=E4=B8=BA40%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-cd.yml | 2 ++ scripts/ci_coverage_summary.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 3015bd3fb..3e875526e 100755 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -439,6 +439,8 @@ jobs: - name: Coverage summary if: always() shell: sh + env: + COVERAGE_THRESHOLD: "40" run: | set +e echo "=== 覆盖率汇总 ===" diff --git a/scripts/ci_coverage_summary.py b/scripts/ci_coverage_summary.py index 24c2ae6a3..d9ff2410f 100755 --- a/scripts/ci_coverage_summary.py +++ b/scripts/ci_coverage_summary.py @@ -4,7 +4,9 @@ import sys import xml.etree.ElementTree as ET -THRESHOLD = 65 # 行覆盖率门槛,百分比 +import os + +THRESHOLD = int(os.environ.get("COVERAGE_THRESHOLD", 65)) # 行覆盖率门槛,百分比,可通过环境变量覆盖 def main() -> int: