Repository navigation
86 lines (74 loc) · 2.79 KB
/
Copy pathcodeql.yml
File metadata and controls
86 lines (74 loc) · 2.79 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
name: "CodeQL"
on:
push:
branches: [ "master" ]
pull_request:
# closed is listed only so that closing or merging a PR starts a run that, through the concurrency
# group below, cancels the CI still running for it; all the jobs of that run are skipped.
types: [opened, synchronize, reopened, closed]
branches: [ "master" ]
schedule:
- cron: "59 1 * * 2"
# same policy as in ci.yml: cancel superseded pull request runs, collapse queued runs on branches
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
if: github.event.action != 'closed'
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- language: javascript
build-mode: none
- language: python
build-mode: none
- language: cpp
build-mode: manual
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Packages (cpp)
if: ${{ matrix.language == 'cpp' }}
run: |
sudo apt-get update
sudo apt-get install --yes libboost-all-dev libfftw3-dev libopenblas-dev libopenmpi-dev
- name: Configure (cpp)
if: ${{ matrix.language == 'cpp' }}
run: ./configure --enable-modules=all --disable-asmjit
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: +security-and-quality
config-file: ./.github/codeql/codeql-config.yml
# Must come after init so CodeQL can trace the compiler calls
- name: Build (cpp)
if: ${{ matrix.build-mode == 'manual' }}
run: make -j$(nproc)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"
# Keep debug uploads on analysis failure. Successful reports are
# filtered narrowly below before uploading, including empty reports.
upload: failure-only
output: ${{ runner.temp }}/codeql-results
- name: Filter documented imported-code notes and opaque-output false positive
if: matrix.language == 'cpp'
run: |
python3 .github/codeql/test-filter-sarif.py
python3 .github/codeql/filter-sarif.py "$RUNNER_TEMP/codeql-results"
- name: Upload CodeQL results
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: ${{ runner.temp }}/codeql-results
category: "/language:${{ matrix.language }}"