Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Improve clang tidy job #2365

Merged
merged 14 commits into from
Aug 21, 2023
4 changes: 1 addition & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ clang_tidy:
-DACTS_BUILD_EVERYTHING=on
-DACTS_RUN_CLANG_TIDY=on

- mkdir clang-tidy

# Main clang-tidy run during cmake compilation
- CI/clang_tidy/run_clang_tidy.sh build | tee clang-tidy/clang-tidy.log
paulgessinger marked this conversation as resolved.
Show resolved Hide resolved
- CI/clang_tidy/run_clang_tidy.sh clang-tidy build

# Install dependencies for processing scripts
- pip install -r CI/clang_tidy/requirements.txt
Expand Down
23 changes: 21 additions & 2 deletions CI/clang_tidy/run_clang_tidy.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
#!/bin/bash

set -e

output_dir=$1
shift
build_dir=$1
shift

export NINJA_STATUS="[ninja][%f/%t] "
mkdir -p $output_dir
output_dir=$(realpath $output_dir)

pushd $build_dir
ninja | grep -v '\[ninja\]'
NINJA_STATUS="[ninja] [%f/%t] " ninja $@ | tee $output_dir/ninja.log
popd

# grep fails if it does not find anything
set +e
rm $output_dir/clang-tidy.log
cat $output_dir/ninja.log | grep -v '\[ninja\]' > $output_dir/clang-tidy.log
set -e

if [ ! -f $output_dir/clang-tidy.log ]; then
exit 1
fi

exit 0
Loading