Skip to content

Commit ae2d38b

Browse files
authored
[CI] FIx clang-tidy in CI probably after 4294bca5e (#2220)
The patch added exit code, so some adjustments are needed on our side. Signed-off-by: Sidorov, Dmitry <[email protected]>
1 parent 865af5d commit ae2d38b

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

.github/workflows/check-code-style.yml

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -96,41 +96,7 @@ jobs:
9696
run: |
9797
cat diff-to-inspect.txt | /usr/lib/llvm-${{ env.LLVM_VERSION }}/share/clang/clang-tidy-diff.py \
9898
-p1 -clang-tidy-binary clang-tidy-${{ env.LLVM_VERSION }} -quiet \
99-
-path ${{ github.workspace}}/build > clang-tidy.log 2>/dev/null
100-
# By some reason, clang-tidy log contains tons of extra empty lines,
101-
# that confuse the check below
102-
sed -i '/^$/d' clang-tidy.log
103-
if [ -s clang-tidy.log ]; then
104-
if ! grep -q "No relevant changes found." clang-tidy.log; then
105-
# Emit annotations
106-
while read -r line; do
107-
type="error"
108-
if [[ $line == *"warning:"* ]]; then
109-
type="warning"
110-
elif [[ $line == *"error:"* ]]; then
111-
type="error"
112-
else
113-
continue
114-
fi
115-
116-
absolute_path=$(echo $line | grep -Po "^[\w\d-./]+(?=:)")
117-
relative_path=${absolute_path##"${{ github.workspace }}"}
118-
119-
line_number=$(echo $line | grep -Po "(?<=:)\d+(?=:\d)")
120-
121-
message=$(echo $line | grep -Po "(?<=${type}: ).*$")
122-
123-
# see [workflow-commands] for documentation
124-
echo "::${type} file=${relative_path},line=${line_number}::${message}"
125-
done < clang-tidy.log
126-
127-
echo "clang-tidy found incorrectly written code:"
128-
cat clang-tidy.log
129-
exit 1
130-
else
131-
rm clang-tidy.log # to avoid uploading empty file
132-
fi
133-
fi
99+
-path ${{ github.workspace}}/build
134100
135101
- name: Upload patch with clang-format fixes
136102
uses: actions/upload-artifact@v2

0 commit comments

Comments
 (0)