Merged
fix opbase action #828
cui_jiahaoAdd on Sep 7
fix opbase action #828
Merged
Merged fromcui_jiahao/opbasemasterintocann/opbasemaster
Total: 2 files changed+25-6
| @@ -9,6 +9,24 @@ | |||
| 9 | # See LICENSE in the root of the software repository for the full text of the License. | 9 | # See LICENSE in the root of the software repository for the full text of the License. |
| 10 | # ----------------------------------------------------------------------------------------------------------- | 10 | # ----------------------------------------------------------------------------------------------------------- |
| 11 | set -e | 11 | set -e |
| 12 | +function DP_ASSERT_EQUAL() { | ||
| 13 | + local actual_value=${1} | ||
| 14 | + local expect_value=${2} | ||
| 15 | + local assert_msg=${3} | ||
| 16 | + local log_flag=${4:-"true"} | ||
| 17 | + local log_path=${5} | ||
| 18 | + if [ "${actual_value}" != "${expect_value}" ]; then | ||
| 19 | + if [ -n "${log_path}" ] && [ -f "${log_path}" ]; then | ||
| 20 | + cat "${log_path}" | ||
| 21 | + fi | ||
| 22 | + LOG_ERROR "${assert_msg} is failed." | ||
| 23 | + exit 1 | ||
| 24 | + else | ||
| 25 | + if [ "${log_flag}" = "true" ]; then | ||
| 26 | + echo "${assert_msg} is success." | ||
| 27 | + fi | ||
| 28 | + fi | ||
| 29 | +} | ||
| 12 | echo $(grep -E "^VERSION_ID=" /etc/os-release | cut -d'"' -f2) | 30 | echo $(grep -E "^VERSION_ID=" /etc/os-release | cut -d'"' -f2) |
| 13 | if [[ "${task_name}" =~ x86_compile_ubuntu24 ]] && [ "${TARGET_BRANCH}" == master ]; then | 31 | if [[ "${task_name}" =~ x86_compile_ubuntu24 ]] && [ "${TARGET_BRANCH}" == master ]; then |
| 14 | echo "api-check=compile" >> "${ATOMGIT_OUTPUT}" | 32 | echo "api-check=compile" >> "${ATOMGIT_OUTPUT}" |
| @@ -40,8 +58,4 @@ fi | |||
| 40 | rm -rf /home/jenkins/opensource/json | 58 | rm -rf /home/jenkins/opensource/json |
| 41 | source /home/jenkins/Ascend/cann/bin/setenv.bash | 59 | source /home/jenkins/Ascend/cann/bin/setenv.bash |
| 42 | bash build.sh --cann_3rd_lib_path=/home/jenkins/opensource -j16 | 60 | bash build.sh --cann_3rd_lib_path=/home/jenkins/opensource -j16 |
| 43 | -echo "exec cmd: [bash build.sh --cann_3rd_lib_path=/home/jenkins/opensource -j16]" | 61 | +DP_ASSERT_EQUAL $? 0 "build ${task_name}" |
| 44 | -compile_package_name=$(ls "${WORKSPACE}/build_out/" |grep -E "*.run$"|head -n1) | ||
| 45 | -echo "compile package name is: ${compile_package_name}" | ||
| 46 | -chmod +x ./build_out/${compile_package_name} | ||
| 47 | -echo "y" | ./build_out/${compile_package_name} --full --install-path=${WORKSPACE}/tmp 2>&1 | tee ${WORKSPACE}/compile_log.txt | ||
| @@ -34,4 +34,9 @@ fi | |||
| 34 | gcc --version | 34 | gcc --version |
| 35 | rm -rf /home/jenkins/opensource/json | 35 | rm -rf /home/jenkins/opensource/json |
| 36 | source /home/jenkins/Ascend/cann/bin/setenv.bash | 36 | source /home/jenkins/Ascend/cann/bin/setenv.bash |
| 37 | -bash build.sh -j -u -j16 | 37 | +bash build.sh -u -j16 |
| 38 | +ret=$? | ||
| 39 | +if [ $ret -ne 200 ] && [ $ret -ne 0 ]; then | ||
| 40 | + echo "run ut fail" | ||
| 41 | + exit 1 | ||
| 42 | +fi | ||