-
-
Notifications
You must be signed in to change notification settings - Fork 418
91 lines (79 loc) · 2.59 KB
/
codeql-analysis.yml
File metadata and controls
91 lines (79 loc) · 2.59 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
---
name: CodeQL
on:
push:
branches:
- main
pull_request:
paths-ignore:
- "**/*.html"
- "**/*.md"
- "**/*.txt"
schedule:
# Check every Saturday at 18:36
- cron: 36 18 * * 6
permissions: {}
jobs:
analyze:
name: Analyze
runs-on: ubuntu-24.04
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
language:
- c-cpp
- python
- actions
concurrency:
group: ${{ github.workflow }}-${{
github.event_name == 'pull_request' &&
github.head_ref || github.sha }}-${{ matrix.language }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.x"
- name: Install non-Python dependencies
if: ${{ matrix.language == 'c-cpp' }}
run: |
sudo apt-get update -y
sudo apt-get install -y wget git gawk findutils
LC_ALL=C.UTF-8 sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update -y
xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
sudo apt-get install -y --no-install-recommends --no-install-suggests
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
if: ${{ matrix.language == 'c-cpp' }}
- name: Initialize CodeQL
uses: github/codeql-action/init@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
- name: Create installation directory
run: |
mkdir "${HOME}/install"
- name: Set LD_LIBRARY_PATH for compilation
run: |
echo "LD_LIBRARY_PATH=${HOME}/install/lib" >> "${GITHUB_ENV}"
- name: Set number of cores for compilation
run: |
echo "MAKEFLAGS=-j$(nproc)" >> "${GITHUB_ENV}"
- name: Build
if: ${{ matrix.language == 'c-cpp' }}
env:
CFLAGS: -std=gnu17
CXXFLAGS: -std=c++17
run: .github/workflows/build_ubuntu-24.04.sh "${HOME}/install"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5
with:
category: "/language:${{matrix.language}}"