-
-
Notifications
You must be signed in to change notification settings - Fork 439
100 lines (85 loc) · 2.71 KB
/
codeql.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
# Copyright (c) 2024 The STE||AR Group
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
name: "CodeQL"
on:
push:
branches: [ "master", "release**" ]
pull_request:
branches: [ "master", "release**" ]
# schedule:
# - cron: '33 1 * * 4'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: manual
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-and-quality
- name: Install CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.22.x'
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- if: matrix.build-mode == 'manual'
run: |
cmake . -Bbuild -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DHPX_WITH_MALLOC=system \
-DHPX_WITH_FETCH_ASIO=ON \
-DHPX_WITH_FETCH_BOOST=ON \
-DHPX_WITH_FETCH_HWLOC=ON \
-DHPX_WITH_EXAMPLES=OFF \
-DHPX_WITH_TESTS=OFF
cmake --build build --target all
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
output: sarif-results
upload: failure-only # disable the upload here - we will upload in a different action
- name: Filter SARIF
uses: advanced-security/filter-sarif@v1
with:
# filter out all files from downloaded dependencies
patterns: |
-**/_deps/**
-**/concurrentqueue.hpp
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/cpp.sarif
# # optional: for debugging the uploaded sarif
# - name: Upload SARIF as a Build Artifact
# uses: actions/upload-artifact@v3
# with:
# name: sarif-results
# path: sarif-results
# retention-days: 1