-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (91 loc) · 2.97 KB
/
codeql.yml
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
108
109
110
name: Semantic Analysis
on:
push:
branches:
- main
tags:
- '*'
paths-ignore:
- '**.md'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths-ignore:
- '**.md'
- 'changelog.lua'
- '.gitignore'
schedule:
- cron: '00 00 * * 6'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
analyze:
name: Scan with CodeQL
runs-on: 'ubuntu-24.04'
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['cpp']
steps:
- name: Checkout Git repository
run: cd .. && git clone https://github.com/evo-lua/evo-runtime --recursive --jobs=$(nproc)
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL scan
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1.2
- name: Update apt cache
run: sudo apt-get update
- name: Install Ninja
run: sudo apt-get install ninja-build
# Can't actually be used on CI runners, but we need the headers for embedding webview
- name: Install WebKitGTK
run: sudo apt-get install gtk+-3.0-dev webkit2gtk-4.1-dev --yes
- name: Install PulseAudio
run: sudo apt-get install pulseaudio libpulse-dev --yes
- name: Configure environment
run: |
export PATH="/usr/lib/ccache:$PATH"
echo "CC=/usr/lib/ccache/gcc" >> $GITHUB_ENV
echo "CXX=/usr/lib/ccache/g++" >> $GITHUB_ENV
- name: Build dependencies
run: bash deps/unixbuild-all.sh
- name: Build the runtime
run: bash ./unixbuild.sh
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
upload: false # Upload separately so it can be filtered
output: sarif-results
- name: Basic sanity check
run: ls -l && ls -l sarif-results && file sarif-results/cpp.sarif
- name: Filter SARIF
uses: advanced-security/filter-sarif@v1
with:
# Getting spammed with library alerts is useless; no one will ever fix them all
patterns: |
+**/*.c
+**/*.cpp
-**/*deps/**
input: sarif-results/${{ matrix.language }}.sarif
output: sarif-results/${{ matrix.language }}.sarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/${{ matrix.language }}.sarif
category: "/language:${{matrix.language}}"
- name: Upload analysis results
uses: actions/upload-artifact@v4
with:
name: sarif-results
path: sarif-results
retention-days: 1