Skip to content

CodeQL

CodeQL #6

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 1 * * 3'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['cpp']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
os: [ubuntu-latest]
config: [Release]
cmake_preset: [linux-ninja-clang14]
steps:
- name: Set up build environment (ubuntu-latest)
run: |
sudo apt-get update
sudo apt-get -y install ccache libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libgtk-3-dev libsdl2-dev ninja-build lld-11
- uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-${{ matrix.os }}-${{ matrix.config }}-${{ github.sha }}
restore-keys: ccache-${{ matrix.os }}-${{ matrix.config }}-
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up SDL 2.26.5 (ubuntu-latest)
run: |
SDL2VER=2.26.5
if [[ ! -e ~/.ccache ]]; then
mkdir ~/.ccache
fi
cd ~/.ccache
if [[ ! -e SDL2-${SDL2VER} ]]; then
curl -sLO https://libsdl.org/release/SDL2-${SDL2VER}.tar.gz
tar -xzf SDL2-${SDL2VER}.tar.gz
cd SDL2-${SDL2VER}
./configure --prefix=/usr/local
make && cd ../
rm SDL2-${SDL2VER}.tar.gz
fi
sudo make -C SDL2-${SDL2VER} install
if: matrix.os == 'ubuntu-latest'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Build
run: |
cmake --preset ${{ matrix.cmake_preset }}
cmake --build build/${{ matrix.cmake_preset }} --config ${{ matrix.config }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2