Skip to content

CodeQL

CodeQL #3032

# 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:
schedule:
- cron: "0 0 * * 0"
pull_request:
paths:
- ".github/workflows/codeql-analysis.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
analyze:
name: Analyze
# Insufficient space to run on public runner, so use custom pool
runs-on: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
container:
image: mcr.microsoft.com/azurelinux/base/core:3.0
options: --user root
permissions:
security-events: write
strategy:
fail-fast: false
matrix:
language: ["cpp"]
steps:
- name: "Checkout dependencies"
shell: bash
run: |
gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY
tdnf -y update
tdnf -y install ca-certificates git tar
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Done before CodeQL init to let it find the commit successfully
- name: Work around git warning
run: git config --global --add safe.directory /__w/CCF/CCF
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-extended
- name: "Install dependencies"
shell: bash
run: |
set -ex
./scripts/setup-ci.sh
- name: "Run CMake"
run: |
set -ex
git config --global --add safe.directory /__w/CCF/CCF
mkdir build
cd build
cmake -DCOMPILE_TARGET=virtual -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=OFF ..
shell: bash
- run: |
cd build
make -j16
name: Run Make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3