Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
solotzg committed Aug 20, 2021
1 parent a028da8 commit 2e37f05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .ci/build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ catchError {
stage("Build & Upload") {
timeout(time: 70, unit: 'MINUTES') {
container("builder") {
sh "NPROC=5 BUILD_BRANCH=${ghprbTargetBranch} release-centos7/build/build-tiflash-ci.sh"
sh "NPROC=5 BUILD_BRANCH=${ghprbTargetBranch} ENABLE_FORMAT_CHECK=true release-centos7/build/build-tiflash-ci.sh"
sh "PULL_ID=${ghprbPullId} COMMIT_HASH=${ghprbActualCommit} release-centos7/build/upload-ci-build.sh"
}
}
Expand Down
14 changes: 10 additions & 4 deletions release-centos7/build/build-tiflash-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ else
echo "ccache has been installed"
fi

command -v clang-format > /dev/null 2>&1
if [[ $? != 0 ]]; then
curl -o "/usr/local/bin/clang-format" http://fileserver.pingcap.net/download/builds/pingcap/tiflash/ci-cache/clang-format
chmod +x "/usr/local/bin/clang-format"
else
echo "clang-format has been installed"
fi

set -ueox pipefail

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
SRCPATH=${1:-$(cd $SCRIPTPATH/../..; pwd -P)}

CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug}
BUILD_BRANCH=${BUILD_BRANCH:-master}
ENABLE_FORMAT_CHECK=${ENABLE_FORMAT_CHECK:-true}
ENABLE_FORMAT_CHECK=${ENABLE_FORMAT_CHECK:-false}

curl -o "/usr/local/bin/clang-format" http://fileserver.pingcap.net/download/builds/pingcap/tiflash/ci-cache/clang-format
chmod +x "/usr/local/bin/clang-format"
if [[ "${CMAKE_BUILD_TYPE}" == "Debug" && "${ENABLE_FORMAT_CHECK}" == "true" ]]; then
if [[ "${ENABLE_FORMAT_CHECK}" == "true" ]]; then
python3 ${SRCPATH}/format-diff.py --repo_path "${SRCPATH}" --check_formatted --diff_from `git merge-base origin/${BUILD_BRANCH} HEAD`
export ENABLE_FORMAT_CHECK=false
fi
Expand Down

0 comments on commit 2e37f05

Please sign in to comment.