diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1106590dc43a84f2496ff20a932d8feabc7ed146..99a25e464cdd09b499b3f7eeabaa57e99c0d8830 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ stages: check:prebuilt: stage: ci script: - - ./paddle/scripts/paddle_build.sh check_style + - ./paddle/fluid/lite/tools/build.sh check_style build:server: image: $SERVER_LITE_DOCKER_IMAGE diff --git a/paddle/fluid/lite/tools/build.sh b/paddle/fluid/lite/tools/build.sh index 2a31f8d1ff9a524d4719cbb3d149bd4f1f5b357f..f0e977e936b723b0cb74010c3d6977df9f60648b 100755 --- a/paddle/fluid/lite/tools/build.sh +++ b/paddle/fluid/lite/tools/build.sh @@ -28,6 +28,18 @@ function cmake_gpu { cmake .. " -DWITH_GPU=ON {common_flags} -DLITE_WITH_GPU=ON" } +function check_style { + pip install cpplint + export PATH=/usr/bin:$PATH + pre-commit install + clang-format --version + + if ! pre-commit run -a ; then + git diff + exit 1 + fi +} + function cmake_arm { # $1: ARM_TARGET_OS in "android" , "armlinux" # $2: ARM_TARGET_ARCH_ABI in "arm64-v8a", "armeabi-v7a" ,"armeabi-v7a-hf" @@ -215,6 +227,10 @@ function main { build_test_arm shift ;; + check_style) + check_style + shift + ;; *) # unknown option print_usage