Merged
fix opbase action #828
cui_jiahaoAdd on Sep 7
fix opbase action #828
Merged
cui_jiahaoAdd on Sep 7
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# -----------------------------------------------------------------------------------------------------------
11set -e11set -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+}
12echo $(grep -E "^VERSION_ID=" /etc/os-release | cut -d'"' -f2)30echo $(grep -E "^VERSION_ID=" /etc/os-release | cut -d'"' -f2)
13if [[ "${task_name}" =~ x86_compile_ubuntu24 ]] && [ "${TARGET_BRANCH}" == master ]; then31if [[ "${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
40rm -rf /home/jenkins/opensource/json58rm -rf /home/jenkins/opensource/json
41source /home/jenkins/Ascend/cann/bin/setenv.bash59source /home/jenkins/Ascend/cann/bin/setenv.bash
42bash build.sh --cann_3rd_lib_path=/home/jenkins/opensource -j1660bash 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
34gcc --version34gcc --version
35rm -rf /home/jenkins/opensource/json35rm -rf /home/jenkins/opensource/json
36source /home/jenkins/Ascend/cann/bin/setenv.bash36source /home/jenkins/Ascend/cann/bin/setenv.bash
37-bash build.sh -j -u -j1637+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