Skip to content

Commit 41833f5

Browse files
QuLogicoscargustacaswell
committed
CI: Add CodeQL analysis
Co-authored-by: Oscar Gustafsson <[email protected]> Co-authored-by: Thomas A Caswell <[email protected]>
1 parent 312fdb7 commit 41833f5

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
name: "CodeQL"
3+
4+
on:
5+
push:
6+
branches: [main, v*.x]
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: [main]
10+
schedule:
11+
- cron: '45 19 * * 1'
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: ['cpp', 'javascript', 'python']
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v4
33+
if: matrix.language != 'javascript'
34+
with:
35+
python-version: '3.x'
36+
- name: Install dependencies
37+
if: matrix.language != 'javascript'
38+
run: |
39+
python -m pip install --upgrade pip setuptools wheel
40+
# TODO: Use pip-tools instead when it supports build-system
41+
# dependencies so we don't need another copy here.
42+
# https://github.com/jazzband/pip-tools/pull/1681
43+
python -m pip install --upgrade \
44+
certifi contourpy cycler fonttools kiwisolver importlib_resources \
45+
numpy packaging pillow pyparsing python-dateutil setuptools-scm
46+
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
47+
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v2
50+
with:
51+
languages: ${{ matrix.language }}
52+
setup-python-dependencies: false
53+
54+
- name: Build compiled code
55+
if: matrix.language == 'cpp'
56+
run: |
57+
mkdir ~/.cache/matplotlib
58+
$CODEQL_PYTHON setup.py build
59+
60+
- name: Perform CodeQL Analysis
61+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)