File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -339,6 +339,7 @@ jobs:
339339 - name : build
340340 run : |
341341 set -e
342+ export USE_COVERAGE=ON
342343 cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${BUILD_TEST1} && cp -R source ${BUILD_TEST1} && cd ${BUILD_TEST1}
343344 cd impl && sh scripts/build_impl.sh ascend
344345 - name : clang-tidy
@@ -367,7 +368,15 @@ jobs:
367368 source impl/scripts/pick_card.sh ascend
368369 cd diopi_test/python && python main.py --mode gen_case --impl_folder ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1}/impl/ascend/ && ${run_test} main.py --mode run_test \
369370 && cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1} && git clean -xdf ${GEN_DATA} || ( cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1} && git clean -xdf ${GEN_DATA} && exit 1 )
370-
371+ if [ "${ALL_COVERAGE}" = "ON" ]; then
372+ bash /mnt/cache/share/platform/dep/sonar/coverage_DIOPI.sh ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1} || echo "get coverage fail"
373+ fi
374+ - name : increment coverage check
375+ if : ${{ contains( github.event_name, 'pull_request' ) && contains( github.base_ref, 'main' ) }}
376+ run : |
377+ set -e
378+ cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1}
379+ bash scripts/increment_coverage.sh ${REQUIRE_COVERAGE}
371380 # Rt-Test-Ascend-910b:
372381 # name: Rt-Test-Ascend-910b
373382 # runs-on: tps-ascend-ci-910b
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ case $1 in
4848 ;;
4949 ascend)
5050 mkdir -p build && cd build
51- cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DIMPL_OPT=ascend -DCMAKE_BUILD_TYPE=Release -DTEST=ON
51+ cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DIMPL_OPT=ascend -DCMAKE_BUILD_TYPE=Release -DTEST=ON -DENABLE_COVERAGE= ${USE_COVERAGE}
5252 make -j16
5353 ;;
5454 hip_pytorch)
Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ while IFS= read -r line; do
4949done < " coverage/gitdiff_screen.txt"
5050
5151echo " export IS_cover=True" > coverage/IS_cover.txt
52- gcovr --csv --gcov-ignore-errors=no_working_dir_found > coverage/coverage.csv
52+ gcovr --csv --gcov-ignore-errors=no_working_dir_found > coverage/coverage.csv 2> /dev/null
5353sed -i ' 1d' coverage/coverage.csv
5454mkdir coverage/html
55- gcovr -r . --html --html-details --gcov-ignore-errors=no_working_dir_found -o coverage/html/index.html
55+ gcovr -r . --html --html-details --gcov-ignore-errors=no_working_dir_found -o coverage/html/index.html 2> /dev/null
5656python scripts/increment_coverage.py $ROOT_DIR /coverage/ $require_coverage
5757source coverage/IS_cover.txt
5858if [ $IS_cover == ' True' ]; then
You can’t perform that action at this time.
0 commit comments