Skip to content

Commit 308b150

Browse files
authored
Add github action for Codeql analysis (cppcheck-opensource#2857)
Create codeql-analysis.yml
1 parent c1212f8 commit 308b150

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "CodeQL"
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
analyze:
7+
name: Analyze
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
# Override automatic language detection by changing the below list
14+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
15+
language: ['cpp', 'python']
16+
# Learn more...
17+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v2
22+
23+
# Initializes the CodeQL tools for scanning.
24+
- name: Initialize CodeQL
25+
uses: github/codeql-action/init@v1
26+
with:
27+
languages: ${{ matrix.language }}
28+
# If you wish to specify custom queries, you can do so here or in a config file.
29+
# By default, queries listed here will override any specified in a config file.
30+
# Prefix the list here with "+" to use these queries and those in the config file.
31+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
32+
setup-python-dependencies: false
33+
34+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
35+
# If this step fails, then you should remove it and run the build manually (see below)
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v1
38+
39+
# ℹ️ Command-line programs to run using the OS shell.
40+
# 📚 https://git.io/JvXDl
41+
42+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
43+
# and modify them (or add more) to build your code if your project
44+
# uses a compiled language
45+
46+
#- run: |
47+
# make bootstrap
48+
# make release
49+
50+
- name: Perform CodeQL Analysis
51+
uses: github/codeql-action/analyze@v1

0 commit comments

Comments
 (0)