Repository navigation
107 lines (103 loc) · 3.74 KB
/
Copy pathcodeql.yml
File metadata and controls
107 lines (103 loc) · 3.74 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CodeQL
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "17 4 * * 1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze ${{ matrix.language }}
runs-on: ${{ matrix.os }}
permissions:
security-events: write
contents: read
actions: read
strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: manual
os: ubuntu-24.04
- language: csharp
build-mode: manual
os: windows-2025
- language: java-kotlin
build-mode: manual
os: ubuntu-24.04
- language: swift
build-mode: manual
os: macos-15
- language: actions
build-mode: none
os: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
if: matrix.language == 'csharp'
with:
dotnet-version: "10.0.x"
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
if: matrix.language == 'java-kotlin'
with:
distribution: temurin
java-version: "25"
- uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
if: matrix.language == 'java-kotlin'
- name: Build XCFramework
if: matrix.language == 'swift'
run: brew install ninja && sh platform/apple/build-xcframework.sh
- uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
config-file: ./.github/codeql/codeql-config.yml
- name: Build C and C++
if: matrix.language == 'c-cpp'
run: |
sudo apt-get update && sudo apt-get install -y ninja-build libcurl4-openssl-dev libgl-dev libegl-dev libx11-dev libxi-dev libxcursor-dev
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
- name: Build C#
if: matrix.language == 'csharp'
run: dotnet build platform/dotnet/Demo/Demo.csproj -c Release -p:Platform=AnyCPU -p:UseSharedCompilation=false
- name: Build Kotlin
if: matrix.language == 'java-kotlin'
working-directory: platform/android
run: ./gradlew --no-daemon --no-build-cache -Pkotlin.compiler.execution.strategy=in-process :mapkern:compileReleaseKotlin :demo:compileReleaseKotlin
- name: Build Swift
if: matrix.language == 'swift'
working-directory: platform/apple
run: swift build
- uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
category: /language:${{ matrix.language }}
upload: failure-only
output: sarif
- name: Collect results
shell: bash
run: f=$(ls sarif/*.sarif | head -1) && mv "$f" sarif/results.sarif
- uses: advanced-security/filter-sarif@2da736ff05ef065cb2894ac6892e47b5eac2c3c0 # v1.1
with:
patterns: |
-build/**
-**/CMakeFiles/**
-**/obj/**
-src/render/shaders/map.glsl.h
-third_party/**
-test/**:cpp/unused-static-function
input: sarif/results.sarif
output: sarif/results.sarif
- uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: sarif/results.sarif
category: /language:${{ matrix.language }}