2022-12-31 17:21:28 +00:00
|
|
|
name: CodeQL
|
|
|
|
|
|
|
|
on:
|
2023-02-15 00:07:07 +00:00
|
|
|
# push:
|
|
|
|
# branches:
|
|
|
|
# - master
|
|
|
|
# pull_request:
|
|
|
|
# # The branches below must be a subset of the branches above
|
|
|
|
# branches:
|
|
|
|
# - master
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
ref:
|
|
|
|
description: 'Ref to build (for Pull Requests, use refs/pull/NNN/head)'
|
|
|
|
required: true
|
2022-12-31 17:21:28 +00:00
|
|
|
|
2023-02-26 21:36:33 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
|
|
|
|
2022-12-31 17:21:28 +00:00
|
|
|
jobs:
|
|
|
|
analyze:
|
|
|
|
name: Analyze
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
actions: read
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-02-15 00:07:07 +00:00
|
|
|
if: github.event_name != 'workflow_dispatch'
|
2022-12-31 17:21:28 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-02-15 00:07:07 +00:00
|
|
|
- name: Checkout (Manual)
|
|
|
|
if: github.event_name == 'workflow_dispatch'
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.inputs.ref }}
|
|
|
|
|
2022-12-31 17:21:28 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
echo "::group::Update apt"
|
|
|
|
sudo apt-get update
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
echo "::group::Install dependencies"
|
|
|
|
sudo apt-get install -y --no-install-recommends \
|
|
|
|
liballegro4-dev \
|
2023-02-12 11:07:31 +00:00
|
|
|
libcurl4-openssl-dev \
|
2022-12-31 17:21:28 +00:00
|
|
|
libfontconfig-dev \
|
2023-04-25 17:43:45 +00:00
|
|
|
libharfbuzz-dev \
|
2022-12-31 17:21:28 +00:00
|
|
|
libicu-dev \
|
|
|
|
liblzma-dev \
|
|
|
|
liblzo2-dev \
|
|
|
|
libsdl2-dev \
|
|
|
|
zlib1g-dev \
|
|
|
|
# EOF
|
|
|
|
echo "::endgroup::"
|
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
|
|
|
|
- name: Set number of make jobs
|
|
|
|
run: |
|
|
|
|
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
|
|
|
uses: github/codeql-action/init@v2
|
|
|
|
with:
|
|
|
|
languages: cpp
|
|
|
|
config-file: ./.github/codeql/codeql-config.yml
|
|
|
|
|
|
|
|
- name: Autobuild
|
|
|
|
uses: github/codeql-action/autobuild@v2
|
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
|
|
|
uses: github/codeql-action/analyze@v2
|
|
|
|
with:
|
|
|
|
category: /language:cpp
|
|
|
|
upload: False
|
|
|
|
output: sarif-results
|
|
|
|
|
|
|
|
- name: Filter out table & generated code
|
|
|
|
uses: advanced-security/filter-sarif@v1
|
|
|
|
with:
|
|
|
|
patterns: |
|
|
|
|
+**/*.*
|
|
|
|
-**/table/*.*
|
|
|
|
-**/generated/**/*.*
|
2023-04-10 17:02:31 +00:00
|
|
|
-**/tests/*.*
|
2022-12-31 17:21:28 +00:00
|
|
|
input: sarif-results/cpp.sarif
|
|
|
|
output: sarif-results/cpp.sarif
|
|
|
|
|
|
|
|
- name: Upload results
|
|
|
|
uses: github/codeql-action/upload-sarif@v2
|
|
|
|
with:
|
|
|
|
sarif_file: sarif-results/cpp.sarif
|