1+ # SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
12# SPDX-License-Identifier: Apache-2.0
2- # NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+ #
34# Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
46# You may obtain a copy of the License at
7+ #
58# http://www.apache.org/licenses/LICENSE-2.0
69#
7- # See the License for the specific language governing permissions and limitations under the License.
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
815
9- name : CodeQL Analysis
16+ name : " CodeQL"
1017
1118on :
1219 push :
1724 - cron : ' 28 22 * * 1'
1825
1926jobs :
20- codeql-analysis :
21- name : CodeQL Analysis
27+ analyze :
28+ name : Analyze
2229 runs-on : ubuntu-22.04-64core
23- container :
24- image : nvidia/cuda:12.2.0-devel-ubuntu22.04
25- options : --user root
2630 timeout-minutes : 360
2731 permissions :
2832 actions : write
@@ -35,73 +39,89 @@ jobs:
3539 language : [ 'c-cpp', 'javascript-typescript', 'python' ]
3640
3741 steps :
38- - name : Set up Environment
39- run : |
40- apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nvidia-open \
41- git git-lfs gcc-11 g++-11 ninja-build build-essential ccache libgtest-dev libgmock-dev \
42- shellcheck curl doxygen python3 python3-pip python3-dev python3-distutils \
43- texlive-latex-extra ghostscript graphviz rsync \
44- && curl -L https://cmake.org/files/v3.20/cmake-3.20.1-linux-x86_64.tar.gz --output /tmp/cmake-3.20.1.tar.gz \
45- && tar -xzf /tmp/cmake-3.20.1.tar.gz -C /tmp/ && cp -r /tmp/cmake-3.20.1-linux-x86_64/bin/ /usr/local/ \
46- && cp -r /tmp/cmake-3.20.1-linux-x86_64/share/ /usr/local/ && cp -r /tmp/cmake-3.20.1-linux-x86_64/doc/ /usr/local/ \
47- && rm -rf /tmp/cmake-3.20.1*
48-
49- - name : Checkout Repository
50- uses : actions/checkout@v4
51- with :
52- lfs : true
53- submodules : recursive
54-
55- - name : Install Python Dependencies (C/C++)
56- if : matrix.language == 'c-cpp'
57- run : |
58- apt-get update -y && apt-get install -y --no-install-recommends \
59- python3 python3-pip python3-dev python3-distutils doxygen \
60- && rm -rf /var/lib/apt/lists/* \
61- && python3 -m pip install sphinx-rtd-theme sphinx breathe recommonmark graphviz \
62- && python3 -m pip install numpy==2.0.1 patchelf==0.17.2.1 \
63- && python3 -m pip install cuda-python==12.2.0 \
64- && python3 -m pip install -U sphinx
65-
66- - name : Initialize CodeQL
67- uses : github/codeql-action/init@v3
68- with :
69- languages : ${{ matrix.language }}
70- queries : +security-and-quality
71-
72- - name : Autobuild (Non C/C++)
73- if : matrix.language != 'c-cpp'
74- uses : github/codeql-action/autobuild@v3
75-
76- - name : Build CMake Project (C/C++)
77- if : matrix.language == 'c-cpp'
78- run : |
79- echo "Running CMake project build script"
80- ./ci/build.sh debug build "-DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PYTHON=ON"
81-
82- - name : Perform CodeQL Analysis
83- uses : github/codeql-action/analyze@v3
84- with :
85- category : " /language:${{ matrix.language }}"
86-
87- - name : Build and Clean Documentation (C/C++, Push Event)
88- if : matrix.language == 'c-cpp' && github.event_name == 'push'
89- run : |
90- ./ci/build.sh debug build "-DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_DOCS=ON -DBUILD_PYTHON=ON -DPYTHON_VERSIONS=3.10"
91- find build/docs/sphinx -name '*.doctree' -delete
92- find build/docs/sphinx -name '*.map' -delete
93- find build/docs/sphinx -name '*.pickle' -delete
94- find build/docs/sphinx -name '*.inv' -delete
95- find build/docs/sphinx -name '*.gz' -delete
96-
97- - name : Create .nojekyll File (C/C++, Push Event)
98- if : matrix.language == 'c-cpp' && github.event_name == 'push'
99- run : touch build/docs/sphinx/.nojekyll
100-
101- - name : Deploy to GitHub Pages (C/C++, Push Event)
102- if : matrix.language == 'c-cpp' && github.event_name == 'push'
103- uses : JamesIves/github-pages-deploy-action@v4
104- with :
105- folder : build/docs/sphinx
106- branch : gh-pages
107- clean : true
42+ - name : Checkout repository
43+ uses : actions/checkout@v4
44+ with :
45+ lfs : true
46+ submodules : ' recursive'
47+
48+ - if : matrix.language == 'c-cpp'
49+ name : Setup environment
50+ run : |
51+ sudo apt update -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
52+ sudo apt update -y && sudo apt install -y --no-install-recommends \
53+ git git-lfs gcc-11 g++-11 ninja-build ccache libgtest-dev libgmock-dev \
54+ shellcheck curl doxygen python3 python3-pip python3-dev python3-distutils \
55+ texlive-latex-extra ghostscript graphviz \
56+ && curl -L https://cmake.org/files/v3.20/cmake-3.20.1-linux-x86_64.tar.gz --output /tmp/cmake-3.20.1.tar.gz \
57+ && tar -xzf /tmp/cmake-3.20.1.tar.gz -C /tmp/ && sudo cp -r /tmp/cmake-3.20.1-linux-x86_64/bin/ /usr/local/ \
58+ && sudo cp -r /tmp/cmake-3.20.1-linux-x86_64/share/ /usr/local/ && sudo cp -r /tmp/cmake-3.20.1-linux-x86_64/doc/ /usr/local/ \
59+ && rm -rf /tmp/cmake-3.20.1*
60+
61+ - if : matrix.language == 'c-cpp'
62+ name : Install Python Dependencies
63+ run : |
64+ sudo apt update -y && sudo apt install -y --no-install-recommends \
65+ python3 python3-pip python3-dev python3-distutils doxygen && sudo rm -rf /var/lib/apt/lists/* \
66+ && python3 -m pip install sphinx-rtd-theme sphinx breathe recommonmark graphviz \
67+ && python3 -m pip install numpy==2.0.1 patchelf==0.17.2.1
68+
69+ - if : matrix.language == 'c-cpp'
70+ name : Install CUDA Toolkit
71+ 72+ id : cuda-toolkit
73+ with :
74+ cuda : ' 12.2.0'
75+ linux-local-args : ' ["--toolkit"]'
76+
77+ - if : matrix.language == 'c-cpp'
78+ name : Verify CUDA installation
79+ run : |
80+ echo "Installed CUDA version is: ${{ steps.cuda-toolkit.outputs.cuda }}"
81+ echo "CUDA install location: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}"
82+ sudo ln -s ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}/lib64/libcudart.so \
83+ /usr/lib/x86_64-linux-gnu/libcuda.so
84+ nvcc -V
85+
86+ - name : Initialize CodeQL
87+ uses : github/codeql-action/init@v3
88+ with :
89+ languages : ${{ matrix.language }}
90+ queries : +security-and-quality
91+
92+ - if : matrix.language != 'c-cpp'
93+ name : Autobuild
94+ uses : github/codeql-action/autobuild@v3
95+
96+ - if : matrix.language == 'c-cpp'
97+ name : Build CMake project
98+ run : |
99+ echo "Running CMake project build script"
100+ ./ci/build.sh debug build "-DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PYTHON=ON" $*
101+
102+ - name : Perform CodeQL Analysis
103+ uses : github/codeql-action/analyze@v3
104+ with :
105+ category : " /language:${{matrix.language}}"
106+
107+ - if : matrix.language == 'c-cpp' && github.event_name == 'push'
108+ name : Build Docs and Clean up Sphinx Build Directory
109+ run : |
110+ ./ci/build.sh debug build "-DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_DOCS=ON -DBUILD_PYTHON=ON -DPYTHON_VERSIONS=3.10" $*
111+ find build/docs/sphinx -name '*.doctree' -delete
112+ find build/docs/sphinx -name '*.map' -delete
113+ find build/docs/sphinx -name '*.pickle' -delete
114+ find build/docs/sphinx -name '*.inv' -delete
115+ find build/docs/sphinx -name '*.gz' -delete
116+
117+ - if : matrix.language == 'c-cpp' && github.event_name == 'push'
118+ name : Create .nojekyll file
119+ run : touch build/docs/sphinx/.nojekyll
120+
121+ - if : matrix.language == 'c-cpp' && github.event_name == 'push'
122+ name : Deploy to GitHub Pages
123+ uses : JamesIves/github-pages-deploy-action@v4
124+ with :
125+ folder : build/docs/sphinx
126+ branch : gh-pages
127+ clean : true
0 commit comments