Skip to content

Bump the github-actions group with 2 updates (#447) #1696

Bump the github-actions group with 2 updates (#447)

Bump the github-actions group with 2 updates (#447) #1696

Workflow file for this run

# 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: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
# The traced build plus analysis should take well under this; a stalled
# extractor otherwise occupies a pool agent for the 6h default.
timeout-minutes: 60
runs-on: [self-hosted, 1ES.Pool=gha-scitt-pool]
container:
image: mcr.microsoft.com/azurelinux/base/core:3.0
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro
env:
SCITT_CI: 1
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Setup environment
run: |
gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY
tdnf update -y
tdnf install -y --disablerepo azurelinux-official-ms-non-oss build-essential ca-certificates git
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
# Work-around for https://github.com/actions/runner/issues/2033
- name: Work around git safe.directory in container
run: chown -R $(id -u):$(id -g) $PWD
- name: Setup dependencies
if: matrix.language == 'cpp'
run: ./scripts/setup-env.sh
# The Python extractor only needs an interpreter, not the CCF toolchain.
# 'which' is required by the extractor's autobuild.sh to locate python3.
- name: Setup Python
if: matrix.language == 'python'
run: tdnf install -y --disablerepo azurelinux-official-ms-non-oss python3 python3-pip which
# Configure and build the third-party dependencies *before* CodeQL starts
# tracing. The extractor runs inline with every traced compiler call, and
# the template-heavy trieste/rego-cpp translation units take far longer to
# extract than to compile, for code we do not own and do not analyse.
- name: Pre-build dependencies (untraced)
if: matrix.language == 'cpp'
# Ninja defaults to cores+2 jobs; the trieste/rego-cpp translation units
# are heavy enough that this exhausts the agent and the build crawls.
env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
run: |
cd app
cmake --preset codeql --fresh
cmake --build --preset codeql --target rego qcbor
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
with:
languages: ${{ matrix.language }}
queries: security-extended
# 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.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
#- name: Autobuild
# uses: github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# Only the application target is built here, and its dependencies are
# already up to date, so the traced build covers our sources alone. The
# 'codeql' preset also has BUILD_TESTS=OFF: unit tests are not shipped code.
- if: matrix.language == 'cpp'
name: Build C++
run: |
cd app
cmake --build --preset codeql --target scitt
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
with:
category: "/language:${{matrix.language}}"