🔧 chore(workflow): require Python 3.11 in runners
This commit is contained in:
@@ -118,7 +118,7 @@ jobs:
|
|||||||
# 注:经 workflow_run 触发,事件 payload 为 workflow_run,不含 PR title;
|
# 注:经 workflow_run 触发,事件 payload 为 workflow_run,不含 PR title;
|
||||||
# lint 脚本会回落到 head commit message 校验(PR 标题本身不再校验)。
|
# lint 脚本会回落到 head commit message 校验(PR 标题本身不再校验)。
|
||||||
echo "🔍 检查 commit message 规范(上游事件: $SOURCE_EVENT)..."
|
echo "🔍 检查 commit message 规范(上游事件: $SOURCE_EVENT)..."
|
||||||
python3 .gitea/ci/commit_message_lint.py
|
python3.11 .gitea/ci/commit_message_lint.py
|
||||||
echo "✅ Lint 检查通过"
|
echo "✅ Lint 检查通过"
|
||||||
|
|
||||||
- name: 🧪 运行全量测试
|
- name: 🧪 运行全量测试
|
||||||
@@ -135,14 +135,14 @@ jobs:
|
|||||||
npm ci --ignore-scripts --no-audit --no-fund --no-bin-links
|
npm ci --ignore-scripts --no-audit --no-fund --no-bin-links
|
||||||
|
|
||||||
echo "📋 覆盖:CLI、subtree/snapshot 部署路线、模板同步、文档一致性"
|
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 "✅ Python 测试通过"
|
||||||
|
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
echo "🧭 TSL Syntax Reference 结构检查"
|
echo "🧭 TSL Syntax Reference 结构检查"
|
||||||
echo "========================================"
|
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 "✅ TSL Syntax Reference 结构检查通过"
|
||||||
|
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
@@ -156,7 +156,7 @@ jobs:
|
|||||||
echo "🔗 文档链接检查"
|
echo "🔗 文档链接检查"
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
|
|
||||||
python3 test/integration/check_doc_links.py
|
python3.11 test/integration/check_doc_links.py
|
||||||
echo "✅ 文档链接检查通过"
|
echo "✅ 文档链接检查通过"
|
||||||
echo "🎉 所有测试完成"
|
echo "🎉 所有测试完成"
|
||||||
|
|
||||||
|
|||||||
@@ -41,13 +41,14 @@ jobs:
|
|||||||
declare -A package_for=(
|
declare -A package_for=(
|
||||||
[git]="git"
|
[git]="git"
|
||||||
[python3]="python3"
|
[python3]="python3"
|
||||||
|
[python3.11]="python3.11"
|
||||||
[curl]="curl"
|
[curl]="curl"
|
||||||
[flock]="util-linux"
|
[flock]="util-linux"
|
||||||
[realpath]="coreutils"
|
[realpath]="coreutils"
|
||||||
[node]="nodejs"
|
[node]="nodejs"
|
||||||
[npm]="npm"
|
[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_commands=()
|
||||||
missing_packages=()
|
missing_packages=()
|
||||||
declare -A seen_packages=()
|
declare -A seen_packages=()
|
||||||
@@ -91,7 +92,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
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 环境"
|
echo "## Prepare 环境"
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ jobs:
|
|||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
bundle="$build_dir/tsl-playbook"
|
bundle="$build_dir/tsl-playbook"
|
||||||
python3 "$BUILD_SCRIPT" --output "$bundle"
|
python3.11 "$BUILD_SCRIPT" --output "$bundle"
|
||||||
|
|
||||||
# 本 workflow 在目标分支上仅拥有以下路径。
|
# 本 workflow 在目标分支上仅拥有以下路径。
|
||||||
managed_paths=(
|
managed_paths=(
|
||||||
|
|||||||
@@ -129,6 +129,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$REPO_DIR"
|
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 "========================================"
|
||||||
echo "📦 Refresh thirdparty/skill snapshots"
|
echo "📦 Refresh thirdparty/skill snapshots"
|
||||||
@@ -216,7 +219,7 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
emit_sources_tsv() {
|
emit_sources_tsv() {
|
||||||
python3 - "$MANIFEST_PATH" <<'PY'
|
"$PYTHON_BIN" - "$MANIFEST_PATH" <<'PY'
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -419,9 +422,11 @@ jobs:
|
|||||||
THIRDPARTY_BRANCH="${THIRDPARTY_BRANCH:-thirdparty/skill}"
|
THIRDPARTY_BRANCH="${THIRDPARTY_BRANCH:-thirdparty/skill}"
|
||||||
TARGET_BRANCH="${TARGET_BRANCH:-main}"
|
TARGET_BRANCH="${TARGET_BRANCH:-main}"
|
||||||
MANIFEST_PATH="${MANIFEST_PATH:-.gitea/ci/thirdparty_skills.json}"
|
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() {
|
emit_sources_tsv() {
|
||||||
python3 - "$MANIFEST_PATH" <<'PY'
|
"$PYTHON_BIN" - "$MANIFEST_PATH" <<'PY'
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -464,7 +469,7 @@ jobs:
|
|||||||
local data_dir_rel="$5"
|
local data_dir_rel="$5"
|
||||||
local scripts_dir_rel="$6"
|
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 json
|
||||||
import pathlib
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
@@ -566,7 +571,7 @@ jobs:
|
|||||||
local output_dir="$2"
|
local output_dir="$2"
|
||||||
local include_paths="$3"
|
local include_paths="$3"
|
||||||
|
|
||||||
python3 - "$snapshot_root" "$output_dir" "$include_paths" <<'PY'
|
"$PYTHON_BIN" - "$snapshot_root" "$output_dir" "$include_paths" <<'PY'
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
|
|||||||
Reference in New Issue
Block a user