🔧 chore(workflow): require Python 3.11 in runners

This commit is contained in:
csh
2026-08-12 08:34:19 +08:00
parent 7cb8b130bb
commit a71480a4ae
4 changed files with 17 additions and 11 deletions
+4 -4
View File
@@ -118,7 +118,7 @@ jobs:
# 注:经 workflow_run 触发,事件 payload 为 workflow_run,不含 PR title
# lint 脚本会回落到 head commit message 校验(PR 标题本身不再校验)。
echo "🔍 检查 commit message 规范(上游事件: $SOURCE_EVENT..."
python3 .gitea/ci/commit_message_lint.py
python3.11 .gitea/ci/commit_message_lint.py
echo "✅ Lint 检查通过"
- name: 🧪 运行全量测试
@@ -135,14 +135,14 @@ jobs:
npm ci --ignore-scripts --no-audit --no-fund --no-bin-links
echo "📋 覆盖:CLI、subtree/snapshot 部署路线、模板同步、文档一致性"
python3 -m unittest discover -s test -p "test_*.py" -v
python3.11 -m unittest discover -s test -p "test_*.py" -v
echo "✅ Python 测试通过"
echo "========================================"
echo "🧭 TSL Syntax Reference 结构检查"
echo "========================================"
python3 skills/tsl-syntax-reference/scripts/lookup.py --check
python3.11 skills/tsl-syntax-reference/scripts/lookup.py --check
echo "✅ TSL Syntax Reference 结构检查通过"
echo "========================================"
@@ -156,7 +156,7 @@ jobs:
echo "🔗 文档链接检查"
echo "========================================"
python3 test/integration/check_doc_links.py
python3.11 test/integration/check_doc_links.py
echo "✅ 文档链接检查通过"
echo "🎉 所有测试完成"
+3 -2
View File
@@ -41,13 +41,14 @@ jobs:
declare -A package_for=(
[git]="git"
[python3]="python3"
[python3.11]="python3.11"
[curl]="curl"
[flock]="util-linux"
[realpath]="coreutils"
[node]="nodejs"
[npm]="npm"
)
required_commands=(git python3 curl flock realpath node npm)
required_commands=(git python3 python3.11 curl flock realpath node npm)
missing_commands=()
missing_packages=()
declare -A seen_packages=()
@@ -91,7 +92,7 @@ jobs:
fi
done
python3 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else "Python 3.11 or newer is required")'
python3.11 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else "Python 3.11 or newer is required")'
{
echo "## Prepare 环境"
+1 -1
View File
@@ -154,7 +154,7 @@ jobs:
trap cleanup EXIT
bundle="$build_dir/tsl-playbook"
python3 "$BUILD_SCRIPT" --output "$bundle"
python3.11 "$BUILD_SCRIPT" --output "$bundle"
# 本 workflow 在目标分支上仅拥有以下路径。
managed_paths=(
@@ -129,6 +129,9 @@ jobs:
run: |
set -euo pipefail
cd "$REPO_DIR"
PYTHON_BIN="${PYTHON_BIN:-$(command -v python3.11 || command -v python3)}"
"$PYTHON_BIN" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else "Python 3.11 or newer is required")'
export PYTHON_BIN
echo "========================================"
echo "📦 Refresh thirdparty/skill snapshots"
@@ -216,7 +219,7 @@ jobs:
}
emit_sources_tsv() {
python3 - "$MANIFEST_PATH" <<'PY'
"$PYTHON_BIN" - "$MANIFEST_PATH" <<'PY'
import json
import sys
@@ -419,9 +422,11 @@ jobs:
THIRDPARTY_BRANCH="${THIRDPARTY_BRANCH:-thirdparty/skill}"
TARGET_BRANCH="${TARGET_BRANCH:-main}"
MANIFEST_PATH="${MANIFEST_PATH:-.gitea/ci/thirdparty_skills.json}"
PYTHON_BIN="${PYTHON_BIN:-$(command -v python3.11 || command -v python3)}"
"$PYTHON_BIN" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else "Python 3.11 or newer is required")'
emit_sources_tsv() {
python3 - "$MANIFEST_PATH" <<'PY'
"$PYTHON_BIN" - "$MANIFEST_PATH" <<'PY'
import json
import sys
@@ -464,7 +469,7 @@ jobs:
local data_dir_rel="$5"
local scripts_dir_rel="$6"
python3 - "$snapshot_root" "$output_dir" "$platform_config_rel" "$template_root_rel" "$data_dir_rel" "$scripts_dir_rel" <<'PY'
"$PYTHON_BIN" - "$snapshot_root" "$output_dir" "$platform_config_rel" "$template_root_rel" "$data_dir_rel" "$scripts_dir_rel" <<'PY'
import json
import pathlib
import shutil
@@ -566,7 +571,7 @@ jobs:
local output_dir="$2"
local include_paths="$3"
python3 - "$snapshot_root" "$output_dir" "$include_paths" <<'PY'
"$PYTHON_BIN" - "$snapshot_root" "$output_dir" "$include_paths" <<'PY'
import os
import pathlib
import shutil