From fb8e582045dc5badc6fb397085788af6886889d1 Mon Sep 17 00:00:00 2001 From: Jiasheng Zhang Date: Fri, 15 Oct 2021 17:27:46 +0800 Subject: [PATCH] [ci] Fix ci shell scripts do not return error code (#3189) * [ci] Fix shell do not return error code --- .github/workflows/presubmit.yml | 5 ++++- .github/workflows/scripts/unix_build.sh | 1 + .github/workflows/scripts/unix_test.sh | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index c648a347d3571..398bfed6631aa 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -109,6 +109,8 @@ jobs: - name: Test run: .github/workflows/scripts/unix_test.sh + env: + RUN_CPP_TESTS: ON build_and_test_cpu: name: Build and Test (CPU) @@ -180,7 +182,7 @@ jobs: .github/workflows/scripts/unix_build.sh env: LLVM_LIB_ROOT_DIR: /opt/taichi-llvm-10.0.0 - CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=ON -DTI_WITH_CC:BOOL=OFF -DTI_WITH_VULKAN:BOOL=ON + CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=ON -DTI_WITH_CC:BOOL=OFF -DTI_WITH_VULKAN:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON BUILD_NUM_THREADS: 8 LLVM_PATH: /opt/taichi-llvm-10.0.0/bin LLVM_DIR: /opt/taichi-llvm-10.0.0/lib/cmake/llvm @@ -191,6 +193,7 @@ jobs: env: DISPLAY: :1 GPU_TEST: ON + RUN_CPP_TESTS: ON build_and_test_windows: name: Build and Test (Windows) diff --git a/.github/workflows/scripts/unix_build.sh b/.github/workflows/scripts/unix_build.sh index 8da0d353b0797..f715a8146bf13 100755 --- a/.github/workflows/scripts/unix_build.sh +++ b/.github/workflows/scripts/unix_build.sh @@ -1,3 +1,4 @@ +set -ex export PATH=`pwd`/taichi-llvm/bin/:$LLVM_PATH:$PATH python3 -m pip uninstall taichi taichi-nightly -y python3 -m pip install -r requirements_dev.txt diff --git a/.github/workflows/scripts/unix_test.sh b/.github/workflows/scripts/unix_test.sh index f810b6d6a85aa..907c52160b8be 100755 --- a/.github/workflows/scripts/unix_test.sh +++ b/.github/workflows/scripts/unix_test.sh @@ -1,6 +1,7 @@ +set -ex TAICHI_REPO_DIR=`pwd` TI_LIB_DIR=`python3 -c "import taichi;print(taichi.__path__[0])" | tail -1` -TI_LIB_DIR="$TI_LIB_DIR/lib" ./build/taichi_cpp_tests +[[ $RUN_CPP_TESTS == "ON" ]] && TI_LIB_DIR="$TI_LIB_DIR/lib" ./build/taichi_cpp_tests export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH ## Only GPU machine uses system python. [ -z $GPU_TEST ] || export PATH=$PATH:$HOME/.local/bin