1414
1515jobs :
1616 analyze :
17- name : 📊 Analyze
17+ name : 📊 Analyze (${{ matrix.language }})
1818 runs-on : ubuntu-latest
1919 permissions :
2020 actions : read
@@ -24,32 +24,44 @@ jobs:
2424 strategy :
2525 fail-fast : false
2626 matrix :
27- language : [ python, javascript, cpp ]
27+ include :
28+ - language : python
29+ build-mode : none
30+ container : ~
31+ - language : javascript
32+ build-mode : none
33+ container : ~
34+ - language : cpp
35+ build-mode : manual
36+ container :
37+ image : ghcr.io/hyperion-project/debian:bookworm-qt6
38+ options : -v /__t/CodeQL:/__t/CodeQL -v /opt/hostedtoolcache/CodeQL:/opt/hostedtoolcache/CodeQL
2839
29- container :
30- image : ghcr.io/hyperion-project/debian:bookworm-qt6
40+ container : ${{ matrix.container }}
3141
3242 steps :
3343 - name : ⬇ Checkout
3444 uses : actions/checkout@v7
3545 with :
3646 submodules : recursive
3747
48+ - name : ⚙️ Mark Workspace Safe for Git
49+ if : ${{ matrix.language == 'cpp' }}
50+ run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
51+
3852 - name : 🔁 Initialize CodeQL
3953 uses : github/codeql-action/init@v4.37.9
4054 with :
4155 languages : ${{ matrix.language }}
56+ build-mode : ${{ matrix.build-mode }}
4257 queries : +security-and-quality
4358 config-file : ./.github/config/codeql.yml
4459
45- - name : 👷 Build (Python & JavaScript)
46- if : ${{ matrix.language != 'cpp' }}
47- uses : github/codeql-action/autobuild@v4.37.9
48-
49- - name : 📥 Install jq (C++)
60+ - name : 📥 Install jq & Pre-Build Deps (C++)
5061 if : ${{ matrix.language == 'cpp' }}
5162 shell : bash
52- run : apt-get update && apt-get install -y jq
63+ run : |
64+ apt-get update && apt-get install -y jq
5365
5466 - name : 💾 Download Pre-Build Dependencies (C++)
5567 if : ${{ matrix.language == 'cpp' }}
@@ -58,16 +70,29 @@ jobs:
5870 with :
5971 os : ' debian_bookworm'
6072 architecture : ' amd64'
61- qt_version : ' 6'
6273 build_type : ${{ github.event_name == 'pull_request' && 'debug' || 'release' }}
6374
75+ - name : ⚡ Setup ccache
76+ if : ${{ matrix.language == 'cpp' }}
77+ uses : hendrikmuhs/ccache-action@v1.2.24
78+ with :
79+ key : ${{ runner.os }}-codeql-ccache-${{ github.ref }}
80+ restore-keys : |
81+ ${{ runner.os }}-codeql-ccache-master
82+ ${{ runner.os }}-codeql-ccache-
83+
6484 - name : 👷 Build (C++)
6585 if : ${{ matrix.language == 'cpp' }}
6686 run : |
67- cmake --preset linux-${{ env.BUILD_TYPE }} ${{ steps.dependencies.outputs.cmakeArgs }}
87+ # Ensure ccache uses the workspace directory shared with the host
88+ export CCACHE_DIR="$GITHUB_WORKSPACE/.ccache"
89+ mkdir -p "$CCACHE_DIR"
90+
91+ cmake --preset linux-${{ env.BUILD_TYPE }} ${{ steps.dependencies.outputs.cmakeArgs }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
6892 cmake --build --preset linux-${{ env.BUILD_TYPE }}
6993 env :
7094 BUILD_TYPE : ${{ github.event_name == 'pull_request' && 'debug' || 'release' }}
95+ CCACHE_DIR : ${{ github.workspace }}/.ccache
7196
7297 - name : 🏃 Perform CodeQL Analysis
7398 uses : github/codeql-action/analyze@v4.37.9
@@ -80,8 +105,16 @@ jobs:
80105 uses : advanced-security/filter-sarif@v1
81106 with :
82107 patterns : |
83- -**/dependencies/**
84- -**/moc_*.cpp
108+ -dependencies/**
109+ -/**/dependencies/**
110+ -moc_*.cpp
111+ -/**/moc_*.cpp
112+ -build/**
113+ -/**/build/**
114+ -*.pb.cc
115+ -/**/*.pb.cc
116+ -*.pb.h
117+ -/**/*.pb.h
85118 input : sarif-results/${{ matrix.language }}.sarif
86119 output : sarif-results/${{ matrix.language }}.sarif
87120
95128 with :
96129 name : ${{ matrix.language }}.sarif
97130 path : sarif-results
98- retention-days : 1
131+ retention-days : 1
0 commit comments