Skip to content

Commit

Permalink
[SOT][ci] add check file run (PaddlePaddle#58051)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: SigureMo <sigure.qaq@gmail.com>
  • Loading branch information
2 people authored and jiahy0825 committed Oct 16, 2023
1 parent 1cd98cd commit 98d2dfa
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions paddle/scripts/paddle_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,53 @@ set -ex
fi
}

function check_run_sot_ci() {
set +x
# use "git commit -m 'message, test=sot'" to force ci to run
COMMIT_RUN_CI=$(git log -1 --pretty=format:"%s" | grep -w "test=sot" || true)
# check pr title
TITLE_RUN_CI=$(curl -s https://github.com/PaddlePaddle/Paddle/pull/${GIT_PR_ID} | grep "<title>" | grep -i "sot" || true)
if [[ ${COMMIT_RUN_CI} || ${TITLE_RUN_CI} ]]; then
set -x
return
fi

# git diff
SOT_FILE_LIST=(
paddle/fluid/operators/run_program_op.h
paddle/fluid/operators/run_program_op.cu
paddle/fluid/operators/run_program_op.cc
paddle/fluid/eager/to_static
paddle/fluid/pybind/
python/
test/sot
)

run_sot_ut="OFF"
for change_file in $(git diff --name-only upstream/develop);
do
for sot_file in ${SOT_FILE_LIST[@]};
do
if [[ ${change_file} =~ ^"${sot_file}".* ]]; then
echo "Detect change about SOT: "
echo "Changes related to the sot code were detected: " ${change_file}
run_sot_ut="ON"
break
fi
done
if [[ "ON" == ${run_sot_ut} ]]; then
break
fi
done

if [[ "OFF" == ${run_sot_ut} ]]; then
echo "No SOT-related changes were found"
echo "Skip SOT UT CI"
exit 0
fi
set -x
}

function run_sot_test() {
PY_VERSION=$1
PYTHON_WITH_SPECIFY_VERSION=python$PY_VERSION
Expand Down Expand Up @@ -4125,6 +4172,7 @@ function main() {
run_linux_cpu_test ${PYTHON_ABI:-""} ${PROC_RUN:-1}
;;
cicheck_sot)
check_run_sot_ci
export WITH_SHARED_PHI=ON
PYTHON_VERSIONS=(3.8 3.9 3.10 3.11)
for PY_VERSION in ${PYTHON_VERSIONS[@]}; do
Expand Down

0 comments on commit 98d2dfa

Please sign in to comment.