feat: 项目整体命名修改cache-schema-checker
All checks were successful
缓存序列化结构检查 / cache-schema-check (push) Has been skipped
All checks were successful
缓存序列化结构检查 / cache-schema-check (push) Has been skipped
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
name: Redis序列化结构检查
|
||||
run-name: ${{ gitea.actor }}的Redis结构检查
|
||||
name: 缓存序列化结构检查
|
||||
run-name: ${{ gitea.actor }}的缓存结构检查
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
# redis-schema-checker 私库坐标:com.codechecker:redis-schema-checker:1.0.0
|
||||
REDIS_SCHEMA_CHECKER_VERSION: "1.0.0"
|
||||
REDIS_SCHEMA_CHECKER_REPO_URL: "http://192.168.3.25:18081/nexus/repository/maven-releases"
|
||||
# cache-schema-checker 私库坐标:com.codechecker:cache-schema-checker:1.0.0
|
||||
CACHE_SCHEMA_CHECKER_VERSION: "1.0.0"
|
||||
CACHE_SCHEMA_CHECKER_REPO_URL: "http://192.168.3.25:18081/nexus/repository/maven-releases"
|
||||
|
||||
jobs:
|
||||
redis-schema-check:
|
||||
cache-schema-check:
|
||||
if: ${{ gitea.ref != 'refs/heads/pre' && gitea.ref != 'refs/heads/dev' && gitea.ref != 'refs/heads/master-2.0' }}
|
||||
runs-on: jdk11
|
||||
steps:
|
||||
@@ -26,26 +26,26 @@ jobs:
|
||||
|
||||
- name: 检查配置文件
|
||||
run: |
|
||||
if [ ! -f .gitea/config/redis-schema-check-config.yaml ]; then
|
||||
echo "错误: 缺少 .gitea/config/redis-schema-check-config.yaml"
|
||||
if [ ! -f .gitea/config/cache-schema-check-config.yaml ]; then
|
||||
echo "错误: 缺少 .gitea/config/cache-schema-check-config.yaml"
|
||||
exit 1
|
||||
fi
|
||||
# 顶层总开关 enabled: false 时跳过后续步骤(与 notify.enabled 区分,仅匹配行首)
|
||||
if grep -Eq '^enabled:[[:space:]]*false([[:space:]]|#|$)' .gitea/config/redis-schema-check-config.yaml; then
|
||||
echo "总开关 enabled=false,跳过 Redis 结构检查"
|
||||
touch /tmp/redis-schema-check.skip
|
||||
if grep -Eq '^enabled:[[:space:]]*false([[:space:]]|#|$)' .gitea/config/cache-schema-check-config.yaml; then
|
||||
echo "总开关 enabled=false,跳过缓存结构检查"
|
||||
touch /tmp/cache-schema-check.skip
|
||||
fi
|
||||
|
||||
- name: 从 Nexus 私库下载 redis-schema-checker
|
||||
- name: 从 Nexus 私库下载 cache-schema-checker
|
||||
run: |
|
||||
if [ -f /tmp/redis-schema-check.skip ]; then
|
||||
if [ -f /tmp/cache-schema-check.skip ]; then
|
||||
echo "总开关已关闭,跳过下载"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
GROUP_PATH="com/codechecker/redis-schema-checker"
|
||||
JAR_NAME="redis-schema-checker-${REDIS_SCHEMA_CHECKER_VERSION}.jar"
|
||||
JAR_URL="${REDIS_SCHEMA_CHECKER_REPO_URL}/${GROUP_PATH}/${REDIS_SCHEMA_CHECKER_VERSION}/${JAR_NAME}"
|
||||
GROUP_PATH="com/codechecker/cache-schema-checker"
|
||||
JAR_NAME="cache-schema-checker-${CACHE_SCHEMA_CHECKER_VERSION}.jar"
|
||||
JAR_URL="${CACHE_SCHEMA_CHECKER_REPO_URL}/${GROUP_PATH}/${CACHE_SCHEMA_CHECKER_VERSION}/${JAR_NAME}"
|
||||
JAR_PATH="/tmp/${JAR_NAME}"
|
||||
|
||||
echo "下载: ${JAR_URL}"
|
||||
@@ -67,15 +67,15 @@ jobs:
|
||||
|
||||
- name: 验证 JDK
|
||||
run: |
|
||||
if [ -f /tmp/redis-schema-check.skip ]; then
|
||||
if [ -f /tmp/cache-schema-check.skip ]; then
|
||||
echo "总开关已关闭,跳过"
|
||||
exit 0
|
||||
fi
|
||||
echo "Java: $(java -version 2>&1 | head -1)"
|
||||
|
||||
- name: 执行 Redis 序列化结构检测
|
||||
- name: 执行缓存序列化结构检测
|
||||
run: |
|
||||
if [ -f /tmp/redis-schema-check.skip ]; then
|
||||
if [ -f /tmp/cache-schema-check.skip ]; then
|
||||
echo "总开关已关闭,跳过检测"
|
||||
exit 0
|
||||
fi
|
||||
@@ -88,8 +88,8 @@ jobs:
|
||||
|
||||
COMMIT_TIME=$(git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
|
||||
|
||||
java -jar "/tmp/redis-schema-checker-${REDIS_SCHEMA_CHECKER_VERSION}.jar" \
|
||||
--config .gitea/config/redis-schema-check-config.yaml \
|
||||
java -jar "/tmp/cache-schema-checker-${CACHE_SCHEMA_CHECKER_VERSION}.jar" \
|
||||
--config .gitea/config/cache-schema-check-config.yaml \
|
||||
--repo-root . \
|
||||
--old-sha "$OLD_SHA" \
|
||||
--new-sha "$(git rev-parse HEAD)" \
|
||||
Reference in New Issue
Block a user