Skip to content

Commit c2140ed

Browse files
authored
ci: add CodeQL analysis workflow configuration (#834)
1 parent 7f07ac2 commit c2140ed

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
schedule:
9+
- cron: "32 13 * * 0"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
# Runner size impacts CodeQL analysis time. To learn more, please see:
15+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
16+
# - https://gh.io/supported-runners-and-hardware-resources
17+
# - https://gh.io/using-larger-runners (GitHub.com only)
18+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# required for all workflows
22+
security-events: write
23+
24+
# required to fetch internal or private CodeQL packs
25+
packages: read
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
include:
31+
- language: actions
32+
build-mode: none
33+
- language: csharp
34+
build-mode: none
35+
# Using 'none' because Unity SDK packages don't include .csproj/.sln files.
36+
# CodeQL autobuild cannot detect build scripts for Unity packages.
37+
# Lower quality metrics (66% call targets, 79% type resolution) are acceptable
38+
# for static analysis of Unity SDK code without a full build context.
39+
# c-cpp and Swift analysis removed: Unity SDKs don't include build projects in the repo
40+
# (Unity generates Xcode/Android projects during build). CodeQL's C/C++ autobuilder
41+
# doesn't recognize .mm (Objective-C++) files as source files. The minimal native
42+
# bridge code is low-risk, and the main codebase (C#) is already being analyzed.
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v6
46+
47+
# Initializes the CodeQL tools for scanning.
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v4
50+
with:
51+
languages: ${{ matrix.language }}
52+
build-mode: ${{ matrix.build-mode }}
53+
54+
- name: Perform CodeQL Analysis
55+
uses: github/codeql-action/analyze@v4
56+
with:
57+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)