Skip to content

Commit dab5ef9

Browse files
Create codeql.yml
Signed-off-by: Miles Price <[email protected]>
1 parent 6b35015 commit dab5ef9

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main", "release_v*" ]
17+
pull_request:
18+
branches: [ "main", "release_v*" ]
19+
schedule:
20+
- cron: '28 22 * * 1'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze
25+
runs-on: ${{ (matrix.language == 'c-cpp' && 'ubuntu-20.04-64core') || 'ubuntu-latest' }}
26+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'c-cpp', 'javascript-typescript', 'python' ]
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v3
40+
with:
41+
lfs: true
42+
submodules: 'recursive'
43+
44+
- if: matrix.language == 'c-cpp'
45+
name: Setup environment
46+
run: |
47+
sudo apt update -y && sudo apt install -y --no-install-recommends \
48+
git git-lfs gcc-11 g++-11 ninja-build ccache libgtest-dev libgmock-dev \
49+
shellcheck curl doxygen python3 python3-pip python3-dev python3-distutils
50+
51+
- if: matrix.language == 'c-cpp'
52+
name: Install Python Dependencies
53+
run: |
54+
python3 -m pip install sphinx-rtd-theme sphinx==4.5.0 breathe exhale \
55+
recommonmark graphviz numpy==1.24.1
56+
57+
- if: matrix.language == 'c-cpp'
58+
name: Install CUDA Toolkit
59+
uses: Jimver/[email protected]
60+
id: cuda-toolkit
61+
with:
62+
cuda: '11.7.1'
63+
linux-local-args: '["--toolkit"]'
64+
65+
- if: matrix.language == 'c-cpp'
66+
name: Verify CUDA installation
67+
run: |
68+
echo "Installed CUDA version is: ${{ steps.cuda-toolkit.outputs.cuda }}"
69+
echo "CUDA install location: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}"
70+
sudo ln -s ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}/lib64/libcudart.so \
71+
/usr/lib/x86_64-linux-gnu/libcuda.so
72+
nvcc -V
73+
74+
- name: Initialize CodeQL
75+
uses: github/codeql-action/init@v2
76+
with:
77+
languages: ${{ matrix.language }}
78+
queries: +security-and-quality
79+
80+
- if: matrix.language != 'c-cpp'
81+
name: Autobuild
82+
uses: github/codeql-action/autobuild@v2
83+
84+
- if: matrix.language == 'c-cpp'
85+
name: Build CMake project
86+
run: |
87+
echo "Running CMake project build script"
88+
./ci/build.sh debug build "-DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF" $*
89+
90+
- name: Perform CodeQL Analysis
91+
uses: github/codeql-action/analyze@v2
92+
with:
93+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)