-
Notifications
You must be signed in to change notification settings - Fork 23
139 lines (121 loc) · 3.63 KB
/
codeql-analysis.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CodeQL
on:
push:
branches: [ 'main' ]
paths:
- '**/*.hpp'
- '**/*.cpp'
- '**/*.cmake'
- '**/CMakeLists.txt'
- '**/*.py'
- 'libs/**'
- '.github/workflows/codeql-analysis.yml'
pull_request:
branches: [ 'main' ]
paths:
- '**/*.hpp'
- '**/*.cpp'
- '**/*.cmake'
- '**/CMakeLists.txt'
- '**/*.py'
- 'libs/**'
- '.github/workflows/codeql-analysis.yml'
merge_group:
schedule:
- cron: '30 5 * * 6'
env:
Z3_VERSION: 4.10.0
jobs:
analyze:
name: Analyze ${{ matrix.language }}
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
compiler: [ g++-11 ]
build_type: [ Release ]
steps:
- name: Install libraries and the respective compiler
run: sudo apt-get update && sudo apt-get install -yq libtbb-dev ${{matrix.compiler}}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9.x'
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
key: '${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}'
variant: ccache
save: true
max-size: 10G
- name: Setup mold
uses: rui314/setup-mold@v1
- name: Install pip packages
uses: BSFishy/pip-action@v1
with:
requirements: ${{github.workspace}}/libs/mugen/requirements.txt
- name: Setup Z3 Solver
id: z3
uses: cda-tum/setup-z3@v1
with:
version: ${{env.Z3_VERSION}}
platform: linux
architecture: x64
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config-file: .github/codeql-config.yml
- if: matrix.language == 'cpp'
name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- if: matrix.language == 'cpp'
name: Configure CMake
working-directory: ${{github.workspace}}/build
run: >
cmake ${{github.workspace}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DFICTION_CLI=ON
-DFICTION_TEST=ON
-DFICTION_EXPERIMENTS=ON
-DFICTION_Z3=ON
-DFICTION_ENABLE_MUGEN=ON
-DFICTION_PROGRESS_BARS=OFF
-DMOCKTURTLE_EXAMPLES=OFF
-DWARNINGS_AS_ERRORS=OFF
- if: matrix.language == 'cpp'
name: Build fiction
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
upload: false
output: sarif-results
- name: Filter SARIF file to exclude library warnings
uses: advanced-security/filter-sarif@main
with:
patterns: |
-**/libs/**
-**/docs/**
-**/experiments/**
input: sarif-results/${{ matrix.language }}.sarif
output: sarif-results/${{ matrix.language }}.sarif
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: sarif-results/${{ matrix.language }}.sarif