-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 2.14 KB
/
Copy pathcodeql.yml
File metadata and controls
67 lines (58 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CodeQL
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "23 4 * * 1"
jobs:
analyze:
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: java-kotlin
build-mode: manual
- language: cpp
# manual (not none) is deliberate: a real build gives CodeQL's
# C/C++ extractor macro expansion and include resolution it
# can't get otherwise, which matters more here than the faster
# "overlay-base" incremental database manual mode gives up.
# You may see a log line about falling back to a full database
# because of that, that's expected, not an error.
build-mode: manual
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
if: matrix.language == 'java-kotlin'
with:
distribution: temurin
java-version: "21"
- uses: github/codeql-action/init@v4.37.3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# build-mode: none doesn't work for Kotlin (only Java), CodeQL just
# skips every .kt file. The actual build has to run between init and
# analyze so CodeQL's build tracer can watch it.
- name: Build for CodeQL
if: matrix.language == 'java-kotlin'
run: ./gradlew :core:compileKotlin :desktop:compileKotlin --stacktrace
# native/ isn't wired into CI's default build yet (see docs/BUILDING.md),
# so the cpp scan needs its own manual build step. Skips cleanly if
# there's no NDK toolchain configured, so this doesn't block the
# java-kotlin scan.
- name: Build native/ for CodeQL
if: matrix.language == 'cpp'
run: |
if [ -f native/CMakeLists.txt ]; then
cmake -S native -B native/build-codeql || true
cmake --build native/build-codeql || true
fi
- uses: github/codeql-action/analyze@v4.37.3
with:
category: "/language:${{ matrix.language }}"