update workflow to fix format issue

This commit is contained in:
Feng Chao 2025-03-08 19:09:35 +08:00
parent e5fcdddea0
commit 59632358b5
1 changed files with 9 additions and 7 deletions

View File

@ -18,8 +18,6 @@ concurrency:
cancel-in-progress: true
env:
# WKDIR: '/var/lib/jenkins/workspace'
# WK: '/var/lib/jenkins/workspace/TDinternal'
WKC: '/var/lib/jenkins/workspace/TDinternal/community'
jobs:
@ -36,10 +34,12 @@ jobs:
run: |
set -euo pipefail
target_branch=${{ github.event.pull_request.base.ref }}
# check whether to run tdgpt test cases
# Check whether to run tdgpt test cases
cd ${{ env.WKC }}
changed_files_non_doc=$(git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $target_branch) | grep -v "^docs/en/" | grep -v "^docs/zh/" | grep -v ".md$" | tr '\n' ' ' || :)
echo “changed files exclude doc, ${changed_files_non_doc}"
echo "changed files exclude doc: ${changed_files_non_doc}"
if [[ -n "$changed_files_non_doc" && "$changed_files_non_doc" =~ (forecastoperator\.c|anomalywindowoperator\.c|tanalytics\.h|tanalytics\.c|tdgpt_cases\.task|analytics|tdgpt) ]]; then
run_tdgpt_test="true"
else
@ -47,14 +47,15 @@ jobs:
fi
echo "run tdgpt test: ${run_tdgpt_test}"
# check whether to run function test cases
# Check whether to run function test cases
changed_files_non_tdgpt=$(git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $target_branch) | \
grep -v "^docs/en/" | \
grep -v "^docs/zh/" | \
grep -v ".md$" | \
grep -Ev "forecastoperator\.c|anomalywindowoperator\.c|tanalytics\.h|tanalytics\.c|tdgpt_cases\.task|analytics|tdgpt" | \
tr '\n' ' ' || :)
echo "changed file exclude tdgpt: ${changed_files_non_tdgpt}"
tr '\n' ' ' || :)
echo "changed files exclude tdgpt: ${changed_files_non_tdgpt}"
if [ -n "$changed_files_non_tdgpt" ]; then
run_function_test="true"
else
@ -62,6 +63,7 @@ jobs:
fi
echo "run function test: ${run_function_test}"
# Output the results for GitHub Actions
echo "run_function_test=$run_function_test" >> $GITHUB_OUTPUT
echo "run_tdgpt_test=$run_tdgpt_test" >> $GITHUB_OUTPUT