46
46
linux :
47
47
runs-on : ubuntu-latest
48
48
env :
49
+ JOB_NAME : linux.${{ inputs.distro }}.${{ inputs.compiler-family }}${{ inputs.compiler-version }}.${{ inputs.flavor }}
49
50
SONAR_SCANNER_VERSION : 5.0.1.3006
50
51
name : ${{ inputs.distro }}.${{ inputs.compiler-family }}${{ inputs.compiler-version }}.${{ inputs.flavor }}
51
52
container :
@@ -137,7 +138,8 @@ jobs:
137
138
fi
138
139
if [ "$COMPILER_FAMILY" = "LLVM" ]; then
139
140
eatmydata apt install clang-${{ inputs.compiler-version }} \
140
- libomp-${{ inputs.compiler-version }}-dev
141
+ libomp-${{ inputs.compiler-version }}-dev \
142
+ python3
141
143
fi
142
144
if [ "$ENABLE_SAMPLE_BASED_TESTING" = "true" ]; then
143
145
eatmydata apt install zstd
@@ -228,6 +230,7 @@ jobs:
228
230
uses : github/codeql-action/init@v3
229
231
with :
230
232
languages : cpp
233
+ source-root : ${{ github.workspace }}/rawspeed
231
234
- name : Set up JDK 11 (for SonarCloud static analysis)
232
235
timeout-minutes : 1
233
236
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 +267,7 @@ jobs:
264
267
env :
265
268
CC : ${{ inputs.compiler-CC }}
266
269
CXX : ${{ inputs.compiler-CXX }}
270
+ FAMILY : ${{ inputs.compiler-family }}
267
271
CLANG_TIDY : ${{ inputs.compiler-CLANG_TIDY }}
268
272
GCOV : ${{ inputs.compiler-GCOV }}
269
273
SRC_DIR : ${{ github.workspace }}/rawspeed
@@ -279,14 +283,15 @@ jobs:
279
283
cmake -E make_directory "${INSTALL_PREFIX}"
280
284
export ECO="${ECO} -DRAWSPEED_REFERENCE_SAMPLE_ARCHIVE=${RPUU_DST}"
281
285
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
283
- export ECO="${ECO} -DRAWSPEED_ENABLE_WERROR=OFF "
286
+ if [ "$FAMILY " = "LLVM " ]; then
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,23 @@ jobs:
295
300
run : |
296
301
set -xe
297
302
"${SRC_DIR}/.ci/ci-script.sh"
303
+ - name : Merge clang SARIF reports
304
+ if : inputs.compiler-family == 'LLVM' && !cancelled() && steps.build.conclusion != 'skipped'
305
+ timeout-minutes : 1
306
+ env :
307
+ SRC_DIR : ${{ github.workspace }}/rawspeed
308
+ run : |
309
+ set -xe
310
+ "${SRC_DIR}/.ci/clang-sarif-merge.py" --output="${GITHUB_WORKSPACE}/clang_report.json" "${GITHUB_WORKSPACE}/clang_report/"
311
+ cat ""${GITHUB_WORKSPACE}/clang_report.json"
312
+ - name : Upload results of clang compile [SARIF]
313
+ timeout-minutes : 1
314
+ if : inputs.compiler-family == 'LLVM' && !cancelled() && steps.build.conclusion != 'skipped'
315
+ uses : github/codeql-action/upload-sarif@v3
316
+ with :
317
+ sarif_file : " ${{ github.workspace }}/clang_report.json"
318
+ checkout_path : " ${{ github.workspace }}/rawspeed"
319
+ category : ${{ env.JOB_NAME }}
298
320
- name : Test (unit tests)
299
321
timeout-minutes : 1
300
322
env :
0 commit comments