Skip to content

Upload CodeQL logs.

Upload CodeQL logs. #8

Workflow file for this run

name: "CodeQL"
on:
push:
branches: [ "main", "iglesias-patch-1" ]
pull_request:
branches: [ "main" ]
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: manual
- language: python
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# 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.
# For more 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
- if: matrix.build-mode == 'manual'
shell: bash
run: |
sudo apt-get install libboost-all-dev libgtest-dev
g++ -std=c++20 -DBUILD_ONLY -o nob nob.cpp
./nob
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
continue-on-error: true
id: analyze
- name: Gtgt Analysis Logs
run: |
mkdir -p logs
echo "#$(date)" > logs/codeql-analysis.log
echo "===============================================" >> logs/codeql-analysis.log
echo "${{ toJSON(steps.analyze.outputs) }}" >> logs/codeql-analysis.log
- name: Upload Analysis Logs
uses: actions/upload-artifact@v4
with:
name: codeql-analysis-logs
path: logs/codeql-analysis.log
retention-days: 90
if-no-files-found: warn