Skip to content

Commit b1f4110

Browse files
committed
Add github's CodeQL scanner to CI.
lgtm.com was acquired by github. It is deprecated and on its way out, because they've integrated the functionality itself into github. Take a look at what its official replacement can do. This does run as yet another Actions slot, which is already fairly excessive, but the average runtime seems about 5 minutes so that's not too bad...
1 parent 9d1b59f commit b1f4110

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

.github/codeql/codeql-config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
queries:
2+
- uses: ./.github/codeql/lgtm.qls
3+
4+
paths-ignore:
5+
- 'test cases'

.github/codeql/lgtm.qls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# for some reason this doesn't work by default any way I can see
2+
3+
- import: codeql-suites/python-lgtm.qls
4+
from: codeql/python-queries

.github/workflows/codeql-analysis.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
analyze:
11+
# lgtm.com does not run in forks, for good reason
12+
if: github.repository == 'mesonbuild/meson'
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
22+
- name: Initialize CodeQL
23+
uses: github/codeql-action/init@v2
24+
with:
25+
config-file: .github/codeql/codeql-config.yml
26+
languages: python
27+
# we have none
28+
setup-python-dependencies: false
29+
30+
- name: Perform CodeQL Analysis
31+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)