Skip to content

Commit

Permalink
CI(CodeQL): Run all analysis concurrently, but don't build for python
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix committed Jan 14, 2024
1 parent 83124e5 commit 82b62df
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ on:
- cron: 36 18 * * 6

permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{
github.event_name == 'pull_request' &&
github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze

concurrency:
group: ${{ github.workflow }}-${{
github.event_name == 'pull_request' &&
github.head_ref || github.sha }}-${{ matrix.language }}
cancel-in-progress: true

runs-on: ubuntu-22.04
permissions:
# required for all workflows
Expand All @@ -36,6 +37,13 @@ jobs:
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language:
- c-cpp
- python

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
Expand All @@ -48,6 +56,7 @@ jobs:
.github/workflows/python_requirements.txt
.github/workflows/optional_requirements.txt
- name: Install non-Python dependencies
if: ${{ matrix.language == 'c-cpp' }}
run: |
sudo apt-get update -y
sudo apt-get install -y wget git gawk findutils
Expand All @@ -66,7 +75,7 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: c-cpp,python
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
setup-python-dependencies: false

Expand All @@ -83,10 +92,13 @@ jobs:
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Build
if: ${{ matrix.language == 'c-cpp' }}
env:
CFLAGS: -std=gnu11
CXXFLAGS: -std=c++11
run: .github/workflows/build_ubuntu-22.04.sh "${HOME}/install"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

0 comments on commit 82b62df

Please sign in to comment.