Skip to content

Commit e07754b

Browse files
committed
fix ci
1 parent 7e85cfb commit e07754b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tools/ci/check_validate.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ function LOG {
88

99
LOG "[INFO] Start validate samples changed by pull request ..."
1010

11-
export GRAPH_NET_ROOT=$(cd $(dirname $0)/../.. && pwd)
12-
export GRAPH_NET_EXTRACT_WORKSPACE="${GRAPH_NET_ROOT}/samples"
11+
export GRAPH_NET_EXTRACT_WORKSPACE=$(cd $(dirname $0)/../.. && pwd)
1312
export PYTHONPATH=${GRAPH_NET_EXTRACT_WORKSPACE}:$PYTHONPATH
1413

1514
[ -z "$CUDA_VISIBLE_DEVICES" ] && CUDA_VISIBLE_DEVICES="0"
@@ -18,7 +17,7 @@ function prepare_env() {
1817
git config --global --add safe.directory "*"
1918
num_changed_samples=$(git diff --name-only develop | grep -E "samples/(.*\.py|.*\.json)" | wc -l)
2019
if [ ${num_changed_samples} -eq 0 ]; then
21-
python ${GRAPH_NET_ROOT}/tools/count_sample.py
20+
python ${GRAPH_NET_EXTRACT_WORKSPACE}/tools/count_sample.py
2221
LOG "[INFO] This pull request doesn't change any samples, skip the CI."
2322
exit 0
2423
fi
@@ -38,7 +37,7 @@ function check_validation() {
3837
for file in $(git diff --name-only develop | grep -E "samples/(.*\.py|.*\.json)")
3938
do
4039
LOG "[INFO] Found ${file} modified."
41-
model_path=$(echo "${file}" | sed 's|^samples/||')
40+
model_path=$(dirname ${file})
4241
MODIFIED_MODEL_PATHS[${#MODIFIED_MODEL_PATHS[@]}]=$model_path
4342
done
4443
MODIFIED_MODEL_PATHS=($(echo ${MODIFIED_MODEL_PATHS[@]} | tr ' ' '\n' | sort | uniq))
@@ -75,8 +74,8 @@ function main() {
7574
check_validation_info=$(check_validation)
7675
check_validation_code=$?
7776
summary_problems $check_validation_code "$check_validation_info"
78-
python ${GRAPH_NET_ROOT}/tools/count_sample.py
77+
python ${GRAPH_NET_EXTRACT_WORKSPACE}/tools/count_sample.py
7978
LOG "[INFO] check_validation run success and no error!"
8079
}
8180

82-
main
81+
main

0 commit comments

Comments
 (0)