Skip to content

Commit

Permalink
refactor(build): Unify build and test shell scripts to run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Jul 19, 2022
1 parent 785b3b7 commit 052bf22
Show file tree
Hide file tree
Showing 17 changed files with 189 additions and 589 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/lint_and_test_cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
ulimit -s unlimited
./run.sh build -c --rdsn --test --skip_thirdparty -j $(($(nproc)/2+1))
./run.sh test --rdsn
test_rdsn_ASAN:
name: Test rdsn with ASAN
Expand Down Expand Up @@ -135,6 +136,7 @@ jobs:
export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
ulimit -s unlimited
./run.sh build -c --rdsn --test --sanitizer address --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
./run.sh test --rdsn
test_rdsn_LSAN:
name: Test rdsn with LSAN
Expand Down Expand Up @@ -176,6 +178,7 @@ jobs:
export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
ulimit -s unlimited
./run.sh build -c --rdsn --test --sanitizer leak --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
./run.sh test --rdsn
test_rdsn_UBSAN:
name: Test rdsn with UBSAN
Expand Down Expand Up @@ -217,7 +220,9 @@ jobs:
export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
ulimit -s unlimited
./run.sh build -c --rdsn --test --sanitizer undefined --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
./run.sh test --rdsn
# TODO(yingchun): also need to test ASAN, LSAN, UBSAN
test_pegasus:
name: Test Pegasus
needs: cpp_clang_format_linter
Expand Down Expand Up @@ -249,7 +254,7 @@ jobs:
cmake --build build/ -j $(($(nproc)/2+1))
- name: Compilation
if: steps.changes.outputs.pegasus == 'true' || steps.changes.outputs.thirdparty == 'true'
run: ./run.sh build -c -j $(($(nproc)/2+1))
run: ./run.sh build --test -c -j $(($(nproc)/2+1))
- name: Packaging Server
if: steps.changes.outputs.pegasus == 'true' || steps.changes.outputs.thirdparty == 'true'
run: ./run.sh pack_server
Expand Down
4 changes: 1 addition & 3 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ header:
- 'src/rdsn/src/utils/test/config-empty.ini'
# The MIT License (MIT), Copyright (c) 2015 Microsoft Corporation
- 'cmake_modules/BaseFunctions.cmake'
- 'scripts/learn_stat.py'
- 'src/rdsn/README.md'
- 'src/rdsn/compile_thrift.py'
- 'src/rdsn/include/dsn/c/api_common.h'
Expand Down Expand Up @@ -201,9 +202,6 @@ header:
- 'src/rdsn/include/dsn/utility/utils.h'
- 'src/rdsn/include/dsn/utility/work_queue.h'
- 'src/rdsn/include/dsn/utils/time_utils.h'
- 'src/rdsn/scripts/linux/build.sh'
- 'src/rdsn/scripts/linux/install.sh'
- 'src/rdsn/scripts/linux/learn_stat.py'
- 'src/rdsn/src/aio/aio_provider.cpp'
- 'src/rdsn/src/aio/aio_provider.h'
- 'src/rdsn/src/aio/disk_engine.cpp'
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(THIRDPARTY_ROOT ${PROJECT_ROOT}/thirdparty)
set(THIRDPARTY_INSTALL_DIR ${PROJECT_ROOT}/thirdparty/output)
message(STATUS "THIRDPARTY_INSTALL_DIR = ${THIRDPARTY_INSTALL_DIR}")

# TODO(yingchun): we will remove it later
# Set DSN_ROOT to ./DSN_ROOT, this is where rdsn will be installed
Expand Down
2 changes: 1 addition & 1 deletion cmake_modules/BaseFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ function(dsn_add_object)
endfunction(dsn_add_object)

function(dsn_add_test)
add_definitions(-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=0)
if(${BUILD_TEST})
add_definitions(-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=0)
set(MY_EXECUTABLE_IS_TEST TRUE)
dsn_add_executable()

Expand Down
Loading

0 comments on commit 052bf22

Please sign in to comment.