4646  linux :
4747    runs-on : ubuntu-latest 
4848    env :
49+       JOB_NAME : linux.${{ inputs.distro }}.${{ inputs.compiler-family }}${{ inputs.compiler-version }}.${{ inputs.flavor }} 
4950      SONAR_SCANNER_VERSION : 5.0.1.3006 
5051    name : ${{ inputs.distro }}.${{ inputs.compiler-family }}${{ inputs.compiler-version }}.${{ inputs.flavor }} 
5152    container :
@@ -137,7 +138,8 @@ jobs:
137138          fi 
138139          if [ "$COMPILER_FAMILY" = "LLVM" ]; then 
139140            eatmydata apt install clang-${{ inputs.compiler-version }} \ 
140-                                       libomp-${{ inputs.compiler-version }}-dev 
141+                                   libomp-${{ inputs.compiler-version }}-dev \ 
142+                                   python3 
141143          fi 
142144          if [ "$ENABLE_SAMPLE_BASED_TESTING" = "true" ]; then 
143145            eatmydata apt install zstd 
@@ -228,6 +230,7 @@ jobs:
228230        uses : github/codeql-action/init@v3 
229231        with :
230232          languages : cpp 
233+           source-root : ${{ github.workspace }}/rawspeed 
231234      - name : Set up JDK 11 (for SonarCloud static analysis) 
232235        timeout-minutes : 1 
233236        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:
264267        env :
265268          CC : ${{ inputs.compiler-CC }} 
266269          CXX : ${{ inputs.compiler-CXX }} 
270+           FAMILY : ${{ inputs.compiler-family }} 
267271          CLANG_TIDY : ${{ inputs.compiler-CLANG_TIDY }} 
268272          GCOV : ${{ inputs.compiler-GCOV }} 
269273          SRC_DIR : ${{ github.workspace }}/rawspeed 
@@ -279,14 +283,15 @@ jobs:
279283          cmake -E make_directory "${INSTALL_PREFIX}" 
280284          export ECO="${ECO} -DRAWSPEED_REFERENCE_SAMPLE_ARCHIVE=${RPUU_DST}" 
281285          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/' " 
284288          fi 
285289          "${SRC_DIR}/.ci/ci-script.sh" 
286290       - name : Build 
287291        id : build 
288292        timeout-minutes : ${{ inputs.flavor != 'ClangTidy' && (inputs.flavor != 'CodeQLAnalysis' && 7 || 12) || 25 }} 
289293        env :
294+           FAMILY : ${{ inputs.compiler-family }} 
290295          SRC_DIR : ${{ github.workspace }}/rawspeed 
291296          BUILD_DIR : ${{ github.workspace }}/rawspeed-build 
292297          INSTALL_PREFIX : ${{ github.workspace }}/rawspeed-install 
@@ -295,6 +300,23 @@ jobs:
295300        run : | 
296301          set -xe 
297302          "${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 }} 
298320      - name : Test (unit tests) 
299321        timeout-minutes : 1 
300322        env :
0 commit comments