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] update static checker script to downgrade clang-format version. #2878

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/cpp_linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: pull_request

jobs:
cpp-linter:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: install dev packages
Expand All @@ -23,6 +23,7 @@ jobs:
file-annotations: false
step-summary: true
format-review: true
tidy-checks: '-*' # disable clang-tidy checks.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling clang-tidy checks because the reports generated are just simple warnings and may provide incorrect results.


- name: failing fast
if: steps.linter.outputs.clang-format-checks-failed > 0
Expand Down
27 changes: 1 addition & 26 deletions .github/workflows/static.check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
simple_script_checkers:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Static checks
steps:
- name: Preparing step 1... Checking out
Expand Down Expand Up @@ -41,31 +41,6 @@ jobs:
done
echo "::endgroup::"
echo "changed_file_list=${tmpfile}" >> "$GITHUB_ENV"
- name: /Checker/ clang-format for .cc/.hh/.hpp/.cpp files
# Originally from "pr-prebuild-clang"
# Need "clang-format"
run: |
echo "Check .clang-format file"
if [ ! -f ".clang-format" ]; then
echo "::error .clang-format file not found"
exit 1
fi
for file in `cat $changed_file_list`; do
echo "Checking $file"
if [[ "$file" =~ .*\.hh$ ]] || [[ "$file" =~ .*\.hpp ]] || [[ "$file" =~ .*\.cc$ ]] || [[ "$file" =~ .*\.cpp ]]; then
clang-format -i ${file}
fi
done
git diff -- *.cc *.hh *.hpp *.cpp > .ci.clang-format.patch
SIZE=$(stat -c%s .ci.clang-format.patch)
if [[ $SIZE -ne 0 ]]; then
echo "::group::The clang-format complaints..."
cat .ci.clang-format.patch
echo "::endgroup::"
echo "::error clang-format has found style errors in C++ files."
exit 1
fi
echo "clang-format shows no style errors."
- name: /Checker/ File size check
# Originally from "pr-prebuild-file-size"
run: |
Expand Down
Loading