ci:优化代码仓库克隆和测试流程

- 移除 git clone 命令中的 --depth=1 参数,保留完整历史记录
- 为 gradlew 添加执行权限,确保测试流程顺利进行
This commit is contained in:
gewuyou 2025-07-16 18:46:02 +08:00
parent 5306ffe645
commit 210aad575b
2 changed files with 3 additions and 1 deletions

View File

@ -101,7 +101,7 @@ reset:
- apk add --no-cache git - apk add --no-cache git
- git config --global user.email "pipeline@${GITLAB_URL}" - git config --global user.email "pipeline@${GITLAB_URL}"
- git config --global user.name "Project Pipeline Bot" - git config --global user.name "Project Pipeline Bot"
- git clone --depth=1 --branch main https://oauth2:${PIPELINE_BOT_TOKEN}@${GITLAB_URL}/${CI_PROJECT_PATH}.git repo - git clone --branch main https://oauth2:${PIPELINE_BOT_TOKEN}@${GITLAB_URL}/${CI_PROJECT_PATH}.git repo
- cd repo - cd repo
- git checkout -B test - git checkout -B test
- git push origin test --force - git push origin test --force

View File

@ -8,6 +8,8 @@ build:
rules: rules:
- if: '$CI_COMMIT_BRANCH == "test"' - if: '$CI_COMMIT_BRANCH == "test"'
script: script:
- echo "🔧 授予 gradlew 执行权限..."
- chmod +x gradlew
- ./gradlew clean build - ./gradlew clean build
tags: tags:
- java - java