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