diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 00000000..4761a2ab --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,10 @@ +# CodeQL configuration +# Exclude third-party and build outputs to reduce noise and improve performance +paths-ignore: + - thirdparty/** + - build/** + - Installer/** + - docs/** + +queries: + - uses: security-and-quality \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..76443cdf --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,63 @@ +name: "CodeQL" + +on: + push: + branches: [ main, dev ] + pull_request: + # Run on PRs targeting protected branches + branches: [ main, dev ] + schedule: + - cron: '0 2 * * 0' # Weekly + workflow_dispatch: + +jobs: + analyze: + name: Analyze (CodeQL) + runs-on: ubuntu-24.04 + permissions: + actions: read + security-events: write + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + submodules: true + + - name: Install Dependencies + run: | + sudo apt update + sudo apt install -y \ + cmake build-essential \ + libwayland-bin \ + libwayland-dev libxkbcommon-dev wayland-protocols \ + pkg-config \ + libdbus-1-dev + echo "✅ Dependencies Installed!" + + - name: Install Vulkan SDK + run: | + wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list http://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list + sudo apt update + sudo apt install -y vulkan-sdk xorg-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev + echo "✅ Vulkan SDK Installed!" + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: cpp + config-file: .github/codeql/codeql-config.yml + + - name: Build with CMake + run: | + mkdir -p build/linux-release + cmake -B build/linux-release --preset "linux-release" + cmake --build build/linux-release --preset "Linux Release Build" --parallel $(nproc) + + - name: Run CodeQL analysis + uses: github/codeql-action/analyze@v4 + with: + category: "security-and-quality"