Add CodeQL workflow for GitHub code scanning
This commit is contained in:

committed by
Andrew Johnson

parent
f6cd43b7cc
commit
b7991b6eca
2
.github/codeql.yml
vendored
Normal file
2
.github/codeql.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
paths:
|
||||||
|
- src/tools
|
57
.github/workflows/codeql.yml
vendored
Normal file
57
.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "7.0", "3.13", "3.14", "3.15", "3.16" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "7.0" ]
|
||||||
|
schedule:
|
||||||
|
- cron: "2 10 * * 0"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ python, cpp ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Packages (cpp)
|
||||||
|
if: ${{ matrix.language == 'cpp' }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --yes libreadline-dev
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
config-file: ./.github/codeql.yml
|
||||||
|
queries: +security-and-quality
|
||||||
|
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
if: ${{ matrix.language == 'python' }}
|
||||||
|
|
||||||
|
- name: Build cpp
|
||||||
|
if: ${{ matrix.language == 'cpp' }}
|
||||||
|
run: |
|
||||||
|
g++ --version
|
||||||
|
make --version
|
||||||
|
perl --version
|
||||||
|
make -sj2 || echo '*** Build failed, ignored for lgtm ***'
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
|
with:
|
||||||
|
category: "/language:${{ matrix.language }}"
|
Reference in New Issue
Block a user