@@ -137,7 +137,8 @@ jobs:
137
137
fi
138
138
if [ "$COMPILER_FAMILY" = "LLVM" ]; then
139
139
eatmydata apt install clang-${{ inputs.compiler-version }} \
140
- libomp-${{ inputs.compiler-version }}-dev
140
+ libomp-${{ inputs.compiler-version }}-dev \
141
+ python3
141
142
fi
142
143
if [ "$ENABLE_SAMPLE_BASED_TESTING" = "true" ]; then
143
144
eatmydata apt install zstd
@@ -228,6 +229,7 @@ jobs:
228
229
uses : github/codeql-action/init@v3
229
230
with :
230
231
languages : cpp
232
+ source-root : ${{ github.workspace }}/rawspeed
231
233
- name : Set up JDK 11 (for SonarCloud static analysis)
232
234
timeout-minutes : 1
233
235
if : inputs.flavor == 'SonarCloudStaticAnalysis' && github.repository == 'darktable-org/rawspeed' && github.event_name != 'pull_request' && github.ref_type == 'branch' && (github.ref_name == 'develop' || github.ref_name == 'stable')
@@ -264,6 +266,7 @@ jobs:
264
266
env :
265
267
CC : ${{ inputs.compiler-CC }}
266
268
CXX : ${{ inputs.compiler-CXX }}
269
+ FAMILY : ${{ inputs.compiler-family }}
267
270
CLANG_TIDY : ${{ inputs.compiler-CLANG_TIDY }}
268
271
GCOV : ${{ inputs.compiler-GCOV }}
269
272
SRC_DIR : ${{ github.workspace }}/rawspeed
@@ -279,14 +282,16 @@ jobs:
279
282
cmake -E make_directory "${INSTALL_PREFIX}"
280
283
export ECO="${ECO} -DRAWSPEED_REFERENCE_SAMPLE_ARCHIVE=${RPUU_DST}"
281
284
export ECO="${ECO} -DCMAKE_CXX_CLANG_TIDY_EXPORT_FIXES_DIR=${BUILD_DIR}/clang-tidy/"
282
- if [ "$FLAVOR " = "ClangTidy" ] || [ "$FLAVOR" = "ClangStaticAnalysis" ] || [ "$FLAVOR" = "ClangCTUStaticAnalysis" ] || [ "$FLAVOR" = "CodeQLAnalysis " ]; then
285
+ if [ "$FAMILY " = "LLVM " ]; then
283
286
export ECO="${ECO} -DRAWSPEED_ENABLE_WERROR=OFF"
287
+ export ECO="${ECO} -DCMAKE_CXX_COMPILER_LAUNCHER='${SRC_DIR}/.ci/clang-sarif-wrapper.sh;${GITHUB_WORKSPACE}/clang_report/'"
284
288
fi
285
289
"${SRC_DIR}/.ci/ci-script.sh"
286
290
- name : Build
287
291
id : build
288
292
timeout-minutes : ${{ inputs.flavor != 'ClangTidy' && (inputs.flavor != 'CodeQLAnalysis' && 7 || 12) || 25 }}
289
293
env :
294
+ FAMILY : ${{ inputs.compiler-family }}
290
295
SRC_DIR : ${{ github.workspace }}/rawspeed
291
296
BUILD_DIR : ${{ github.workspace }}/rawspeed-build
292
297
INSTALL_PREFIX : ${{ github.workspace }}/rawspeed-install
@@ -295,6 +300,28 @@ jobs:
295
300
run : |
296
301
set -xe
297
302
"${SRC_DIR}/.ci/ci-script.sh"
303
+ if [ "$FLAVOR" = "ClangTidy" ] || [ "$FLAVOR" = "ClangStaticAnalysis" ] || [ "$FLAVOR" = "ClangCTUStaticAnalysis" ] || [ "$FLAVOR" = "CodeQLAnalysis" ]; then
304
+ exit 0
305
+ else
306
+ MARKER="${GITHUB_WORKSPACE}/clang_report/.warnings"
307
+ [ -f "$MARKER" ] && exit 1 || exit 0
308
+ fi
309
+ - name : Merge clang SARIF reports
310
+ if : inputs.compiler-family == 'LLVM' && !cancelled() && steps.build.conclusion != 'skipped'
311
+ timeout-minutes : 1
312
+ env :
313
+ SRC_DIR : ${{ github.workspace }}/rawspeed
314
+ run : |
315
+ set -xe
316
+ "${SRC_DIR}/.ci/clang-sarif-merge.py" --output="${GITHUB_WORKSPACE}/clang_report.json" "${GITHUB_WORKSPACE}/clang_report/"
317
+ - name : Upload results of clang compile [SARIF]
318
+ timeout-minutes : 1
319
+ if : inputs.compiler-family == 'LLVM' && !cancelled() && steps.build.conclusion != 'skipped'
320
+ uses : github/codeql-action/upload-sarif@v3
321
+ with :
322
+ sarif_file : " ${{ github.workspace }}/clang_report.json"
323
+ checkout_path : " ${{ github.workspace }}/rawspeed"
324
+ category : ${{ job.name }}
298
325
- name : Test (unit tests)
299
326
timeout-minutes : 1
300
327
env :
0 commit comments