Skip to content

More corrections to matrixed workflow #42

More corrections to matrixed workflow

More corrections to matrixed workflow #42

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "CodeQL - Analyze (C++, Python, Actions)"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 3 * * 0' # weekly (UTC) — adjust as needed
workflow_dispatch:
permissions:
actions: read
contents: read
security-events: write
env:
BUILD_TYPE: RelWithDebInfo
CPP_COMPILER: g++
jobs:
codeql:
name: Analyze ${{ matrix.language }} with CodeQL
runs-on: ubuntu-24.04
container:
image: ghcr.io/framework-r-d/phlex-ci:latest
strategy:
fail-fast: false
matrix: # Necessry to disable yaml-language-server warning
language: ['cpp', 'python', 'actions']
timeout-minutes: 120
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: phlex-src
fetch-depth: 0
- name: Setup build environment
uses: ./phlex-src/.github/actions/setup-build-env
with:
build-path: phlex-build
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
config-file: phlex-src/.github/codeql/codeql-config.yml
working-directory: phlex-src
- name: Configure CMake (C++ only)
if: matrix.language == 'cpp'
uses: ./phlex-src/.github/actions/configure-cmake
with:
build-type: ${{ env.BUILD_TYPE }}
cpp-compiler: ${{ env.CPP_COMPILER }}
build-path: phlex-build
- name: Build C++ code (C++ only)
if: matrix.language == 'cpp'
uses: ./phlex-src/.github/actions/build-cmake
with:
build-path: phlex-build
# Run CodeQL analysis (uploads results to code scanning)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: ${{ matrix.language }}