Skip to content

ci: Simplify CodeQL setup #27733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 4 additions & 22 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,23 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ['cpp', 'javascript', 'python']
language: ['c-cpp', 'javascript', 'python']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
if: matrix.language != 'javascript'
with:
python-version: '3.x'
- name: Install dependencies
if: matrix.language != 'javascript'
run: |
python -m pip install --upgrade pip setuptools wheel
# TODO: Use pip-tools instead when it supports build-system
# dependencies so we don't need another copy here.
# https://github.com/jazzband/pip-tools/pull/1681
python -m pip install --upgrade \
build contourpy cycler fonttools kiwisolver \
importlib_resources meson-python numpy packaging pillow pybind11 \
pyparsing python-dateutil setuptools-scm
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
setup-python-dependencies: false

- name: Build compiled code
if: matrix.language == 'cpp'
if: matrix.language == 'c-cpp'
run: |
mkdir ~/.cache/matplotlib
$CODEQL_PYTHON -m build
pip install --user --upgrade pip
pip install --user -v .

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3