Skip to content

Commit

Permalink
update ci/cd process
Browse files Browse the repository at this point in the history
Signed-off-by: Zhigao Tong <[email protected]>
  • Loading branch information
solotzg committed Mar 10, 2022
1 parent eb81c22 commit 43387df
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .ci/integration_test.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ catchError {
timeout(time: 60, unit: 'MINUTES') {
container("golang") {
sh """
rm -rf ${curws}/tics/contrib
rm -rf ${curws}/tics/.git
COMMIT_HASH=${params.ghprbActualCommit} PULL_ID=${params.ghprbPullId} TAR_PATH=${curws}/tics/tests/.build bash -e ${curws}/tics/release-centos7/build/fetch-ci-build.sh
"""
}
Expand Down
21 changes: 19 additions & 2 deletions release-centos7/build/build-tiflash-ci.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

set -x

ARCH=$(uname -p)

command -v ccache >/dev/null 2>&1
if [[ $? != 0 ]]; then
echo "try to install ccache"
Expand All @@ -18,7 +22,18 @@ else
fi
clang-format --version

set -ueox pipefail
command -v cmake-3.22 >/dev/null 2>&1
if [[ $? != 0 ]]; then
curl -o /root/cmake-3.22.tar.gz http://fileserver.pingcap.net/download/builds/pingcap/tiflash/ci-cache/cmake-3.22.3-linux-${ARCH}.tar.gz
cd /root
tar zxf cmake-3.22.tar.gz
rm -rf /usr/bin/cmake-3.22
ln -s /root/cmake-3.22.3-linux-${ARCH}/bin/cmake /usr/bin/cmake-3.22
rm cmake-3.22.tar.gz
fi
cmake-3.22 --version

set -ueo pipefail

SCRIPTPATH="$(
cd "$(dirname "$0")"
Expand All @@ -34,6 +49,7 @@ BUILD_BRANCH=${BUILD_BRANCH:-master}
ENABLE_FORMAT_CHECK=${ENABLE_FORMAT_CHECK:-false}

if [[ "${ENABLE_FORMAT_CHECK}" == "true" ]]; then
cd ${SRCPATH}
python3 ${SRCPATH}/format-diff.py --repo_path "${SRCPATH}" --check_formatted --diff_from $(git merge-base origin/${BUILD_BRANCH} HEAD) --dump_diff_files_to "/tmp/tiflash-diff-files.json"
export ENABLE_FORMAT_CHECK=false
fi
Expand Down Expand Up @@ -125,11 +141,12 @@ chmod 0731 "${SRCPATH}/libs/libtiflash-proxy/libtiflash_proxy.so"
BUILD_DIR="$SRCPATH/release-centos7/build-release"
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
cmake "$SRCPATH" \
cmake-3.22 -S "$SRCPATH" \
-DENABLE_EMBEDDED_COMPILER=$ENABLE_EMBEDDED_COMPILER \
-DENABLE_TESTS=${ENABLE_TESTS} \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DUSE_CCACHE=${USE_CCACHE} \
-DUSE_INTERNAL_ZLIB_LIBRARY=OFF \
-DDEBUG_WITHOUT_DEBUG_INFO=ON

make -j ${NPROC} tiflash
Expand Down
18 changes: 17 additions & 1 deletion release-centos7/build/build-tiflash-release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
#!/bin/bash

set -x

ARCH=$(uname -p)

command -v cmake-3.22 >/dev/null 2>&1
if [[ $? != 0 ]]; then
curl -o /root/cmake-3.22.tar.gz http://fileserver.pingcap.net/download/builds/pingcap/tiflash/ci-cache/cmake-3.22.3-linux-${ARCH}.tar.gz
cd /root
tar zxf cmake-3.22.tar.gz
rm -rf /usr/bin/cmake-3.22
ln -s /root/cmake-3.22.3-linux-${ARCH}/bin/cmake /usr/bin/cmake-3.22
rm cmake-3.22.tar.gz
fi
cmake-3.22 --version

CMAKE_BUILD_TYPE=$1
CMAKE_PREFIX_PATH=$2

Expand Down Expand Up @@ -29,14 +44,15 @@ ln -s ${SRCPATH}/contrib/tiflash-proxy/target/release/libtiflash_proxy.so ${SRCP
BUILD_DIR="${SRCPATH}/release-centos7/build-release"
rm -rf ${BUILD_DIR} && mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}

cmake "${SRCPATH}" ${DEFINE_CMAKE_PREFIX_PATH} \
cmake-3.22 -S "${SRCPATH}" ${DEFINE_CMAKE_PREFIX_PATH} \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DENABLE_EMBEDDED_COMPILER=${ENABLE_EMBEDDED_COMPILER} \
-DENABLE_ICU=OFF \
-DENABLE_MYSQL=OFF \
-DENABLE_TESTING=OFF \
-DENABLE_TESTS=OFF \
-Wno-dev \
-DUSE_INTERNAL_ZLIB_LIBRARY=OFF \
-DUSE_CCACHE=OFF

make -j ${NPROC} tiflash
Expand Down
18 changes: 17 additions & 1 deletion release-centos7/build/build-tiflash-ut-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
#!/bin/bash

set -x

ARCH=$(uname -p)

command -v cmake-3.22 >/dev/null 2>&1
if [[ $? != 0 ]]; then
curl -o /root/cmake-3.22.tar.gz http://fileserver.pingcap.net/download/builds/pingcap/tiflash/ci-cache/cmake-3.22.3-linux-${ARCH}.tar.gz
cd /root
tar zxf cmake-3.22.tar.gz
rm -rf /usr/bin/cmake-3.22
ln -s /root/cmake-3.22.3-linux-${ARCH}/bin/cmake /usr/bin/cmake-3.22
rm cmake-3.22.tar.gz
fi
cmake-3.22 --version

mkdir -p /build

command -v ccache >/dev/null 2>&1
Expand Down Expand Up @@ -103,13 +118,14 @@ done
BUILD_DIR="/build/release-centos7/build-release"
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
cmake "${SRCPATH}" \
cmake-3.22 -S "${SRCPATH}" \
-DENABLE_EMBEDDED_COMPILER=FALSE \
-DENABLE_TESTS=ON \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DUSE_CCACHE=${USE_CCACHE} \
-DTEST_COVERAGE=ON \
-DTEST_COVERAGE_XML=ON \
-DUSE_INTERNAL_ZLIB_LIBRARY=OFF \
-DDEBUG_WITHOUT_DEBUG_INFO=ON

make -j ${NPROC} gtests_dbms gtests_libcommon gtests_libdaemon
Expand Down

0 comments on commit 43387df

Please sign in to comment.