37
37
steps :
38
38
- name : Checkout oneDNN
39
39
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40
+ with :
41
+ ref : ${{ github.event.pull_request.head.ref }}
42
+ fetch-depth : 0
40
43
41
44
- name : Install clang
42
45
run : |
@@ -48,10 +51,36 @@ jobs:
48
51
env :
49
52
ONEDNN_ACTION : configure
50
53
51
- - name : Build oneDNN
54
+ - name : Check source files
52
55
run : |
53
- .github/automation/x64/build_linters.sh 2>&1 | tee build.log
54
- grep -i "warning:" build.log | sort -u
55
- grep -q -i "warning:" build.log && exit 1 || true
56
- env :
57
- ONEDNN_ACTION : build
56
+ echo -e "Checking Clang-Tidy $(clang-tidy --version)\n"
57
+ touch source-check.log
58
+ for file in $(git diff --name-only ${{ github.event.pull_request.base.sha }} | grep -E '\.cpp$');
59
+ do
60
+ if grep -q "$file" "build/compile_commands.json"; then
61
+ echo -e "\nAnalyzing $file"
62
+ clang-tidy -p build --header-filter='' $file 2>&1 | tee -a source-check.log
63
+ else
64
+ echo "Skipped $file as it's not built in x64 OpenMP/OpenCL configuration."
65
+ fi
66
+ done
67
+ grep -i -E "warning:|error:" source-check.log | sort -u
68
+ grep -q -i -E "warning:|error:" source-check.log && exit 1 || true
69
+
70
+ - name : Check header files
71
+ if : always()
72
+ continue-on-error : true
73
+ run : |
74
+ echo -e "Checking Clang-Tidy $(clang-tidy --version)\n"
75
+ touch headers-check.log
76
+ for file in $(git diff --name-only ${{ github.event.pull_request.base.sha }} | grep -E '\.cpp$');
77
+ do
78
+ if grep -q "$file" "build/compile_commands.json"; then
79
+ echo -e "\nAnalyzing $file"
80
+ clang-tidy -p build $file 2>&1 | tee -a headers-check.log
81
+ else
82
+ echo "Skipped $file as it's not built in x64 OpenMP/OpenCL configuration."
83
+ fi
84
+ done
85
+ grep -i -E "warning:|error:" headers-check.log | sort -u
86
+ grep -q -i -E "warning:|error:" headers-check.log && exit 1 || true
0 commit comments