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,16 @@ 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
286
+ if [ "$FAMILY " = "LLVM " ]; then
283
287
export ECO="${ECO} -DRAWSPEED_ENABLE_WERROR=OFF"
288
+ export ECO="${ECO} -DCMAKE_CXX_COMPILER_LAUNCHER='${SRC_DIR}/.ci/clang-sarif-wrapper.sh;${GITHUB_WORKSPACE}/clang_report/'"
284
289
fi
285
290
"${SRC_DIR}/.ci/ci-script.sh"
286
291
- name : Build
287
292
id : build
288
293
timeout-minutes : ${{ inputs.flavor != 'ClangTidy' && (inputs.flavor != 'CodeQLAnalysis' && 7 || 12) || 25 }}
289
294
env :
295
+ FAMILY : ${{ inputs.compiler-family }}
290
296
SRC_DIR : ${{ github.workspace }}/rawspeed
291
297
BUILD_DIR : ${{ github.workspace }}/rawspeed-build
292
298
INSTALL_PREFIX : ${{ github.workspace }}/rawspeed-install
@@ -295,6 +301,29 @@ jobs:
295
301
run : |
296
302
set -xe
297
303
"${SRC_DIR}/.ci/ci-script.sh"
304
+ if [ "$FLAVOR" = "ClangTidy" ] || [ "$FLAVOR" = "ClangStaticAnalysis" ] || [ "$FLAVOR" = "ClangCTUStaticAnalysis" ] || [ "$FLAVOR" = "CodeQLAnalysis" ]; then
305
+ exit 0
306
+ else
307
+ MARKER="${GITHUB_WORKSPACE}/clang_report/.warnings"
308
+ [ -f "$MARKER" ] && exit 1 || exit 0
309
+ fi
310
+ - name : Merge clang SARIF reports
311
+ if : inputs.compiler-family == 'LLVM' && !cancelled() && steps.build.conclusion != 'skipped'
312
+ timeout-minutes : 1
313
+ env :
314
+ SRC_DIR : ${{ github.workspace }}/rawspeed
315
+ JOB_NAME : ${{ env.JOB_NAME }}
316
+ run : |
317
+ set -xe
318
+ "${SRC_DIR}/.ci/clang-sarif-merge.py" --output="${GITHUB_WORKSPACE}/clang_report.json" "${GITHUB_WORKSPACE}/clang_report/"
319
+ - name : Upload results of clang compile [SARIF]
320
+ timeout-minutes : 1
321
+ if : inputs.compiler-family == 'LLVM' && !cancelled() && steps.build.conclusion != 'skipped'
322
+ uses : github/codeql-action/upload-sarif@v3
323
+ with :
324
+ sarif_file : " ${{ github.workspace }}/clang_report.json"
325
+ checkout_path : " ${{ github.workspace }}/rawspeed"
326
+ category : ${{ env.JOB_NAME }}
298
327
- name : Test (unit tests)
299
328
timeout-minutes : 1
300
329
env :
0 commit comments