Skip to content

Commit

Permalink
[CI] FIx clang-tidy in CI probably after 4294bca5e
Browse files Browse the repository at this point in the history
The patch added exit code, so some adjustments are needed on our side.

Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
  • Loading branch information
MrSidims committed Nov 16, 2023
1 parent 52cc84e commit 0d1db36
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions .github/workflows/check-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,41 +96,7 @@ jobs:
run: |
cat diff-to-inspect.txt | /usr/lib/llvm-${{ env.LLVM_VERSION }}/share/clang/clang-tidy-diff.py \
-p1 -clang-tidy-binary clang-tidy-${{ env.LLVM_VERSION }} -quiet \
-path ${{ github.workspace}}/build > clang-tidy.log 2>/dev/null
# By some reason, clang-tidy log contains tons of extra empty lines,
# that confuse the check below
sed -i '/^$/d' clang-tidy.log
if [ -s clang-tidy.log ]; then
if ! grep -q "No relevant changes found." clang-tidy.log; then
# Emit annotations
while read -r line; do
type="error"
if [[ $line == *"warning:"* ]]; then
type="warning"
elif [[ $line == *"error:"* ]]; then
type="error"
else
continue
fi
absolute_path=$(echo $line | grep -Po "^[\w\d-./]+(?=:)")
relative_path=${absolute_path##"${{ github.workspace }}"}
line_number=$(echo $line | grep -Po "(?<=:)\d+(?=:\d)")
message=$(echo $line | grep -Po "(?<=${type}: ).*$")
# see [workflow-commands] for documentation
echo "::${type} file=${relative_path},line=${line_number}::${message}"
done < clang-tidy.log
echo "clang-tidy found incorrectly written code:"
cat clang-tidy.log
exit 1
else
rm clang-tidy.log # to avoid uploading empty file
fi
fi
-path ${{ github.workspace}}/build
- name: Upload patch with clang-format fixes
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 0d1db36

Please sign in to comment.