-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (58 loc) · 1.95 KB
/
codeql.yml
File metadata and controls
67 lines (58 loc) · 1.95 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 Security Analysis"
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '30 2 * * 1' # Run weekly on Mondays at 2:30 AM
jobs:
analyze:
name: CodeQL Analysis
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get update && sudo apt-get install -y build-essential
sudo apt install cmake ninja-build clang-18 clang-tidy-18 clang-format -y
sudo add-apt-repository ppa:pistache+team/unstable && sudo apt update && sudo apt install libpistache-dev
sudo apt-get install -y libcurl4 libcurl4-openssl-dev libpoco-dev libmysqlcppconn-dev
sudo apt install -y libgtest-dev googletest
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# Enhanced security queries for enterprise-grade scanning
queries: +security-extended,security-and-quality
- name: Setup Build Environment
run: |
export CC=$(which clang-18)
export CXX=$(which clang++-18)
mkdir -p build && cd build
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-Wall -Wextra -fstack-protector-strong -D_FORTIFY_SOURCE=3" \
-DCompileTestsApiFramework=OFF
- name: Build Project
run: |
cd build
export CC=$(which clang-18)
export CXX=$(which clang++-18)
cmake --build . --config Release --target cppapiframework -j $(nproc)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"