-
Notifications
You must be signed in to change notification settings - Fork 14
80 lines (70 loc) · 2.28 KB
/
codeql-analysis.yaml
File metadata and controls
80 lines (70 loc) · 2.28 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "CodeQL - Analyze (C++, Python, Actions)"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 3 * * 0' # weekly (UTC) — adjust as needed
workflow_dispatch:
permissions:
actions: read
contents: read
security-events: write
env:
BUILD_TYPE: RelWithDebInfo
CPP_COMPILER: g++
jobs:
codeql:
name: Analyze ${{ matrix.language }} with CodeQL
runs-on: ubuntu-24.04
container:
image: ghcr.io/framework-r-d/phlex-ci:latest
strategy:
fail-fast: false
matrix: # Necessry to disable yaml-language-server warning
language: ['cpp', 'python', 'actions']
timeout-minutes: 120
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: phlex-src
fetch-depth: 0
- name: Setup build environment
uses: ./phlex-src/.github/actions/setup-build-env
with:
build-path: phlex-build
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
config-file: phlex-src/.github/codeql/codeql-config.yml
source-root: phlex-src
build-mode: ${{ matrix.language == 'cpp' && 'manual' || 'none' }}
- name: Environment diagnostics (C++ only)
if: matrix.language == 'cpp'
run: |
echo "Available trace libraries:"
find /__t/CodeQL/2.23.3/x64/codeql/tools/ -name '*trace.so*' -ls
echo "Environment dump:"
printenv
- name: Configure CMake (C++ only)
if: matrix.language == 'cpp'
uses: ./phlex-src/.github/actions/configure-cmake
with:
build-type: ${{ env.BUILD_TYPE }}
cpp-compiler: ${{ env.CPP_COMPILER }}
build-path: phlex-build
- name: Build C++ code (C++ only)
if: matrix.language == 'cpp'
uses: ./phlex-src/.github/actions/build-cmake
with:
build-path: phlex-build
# Run CodeQL analysis (uploads results to code scanning)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
checkout_path: phlex-src
category: ${{ matrix.language }}