Skip to content

Commit aa685c4

Browse files
authored
Add codeql static analysis (triton-inference-server#219)
* Add codeql static analysis * Run daily jobs Sunday-Friday 6pm * Move codeql to right folder
1 parent 63cc437 commit aa685c4

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions
5+
# are met:
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above copyright
9+
# notice, this list of conditions and the following disclaimer in the
10+
# documentation and/or other materials provided with the distribution.
11+
# * Neither the name of NVIDIA CORPORATION nor the names of its
12+
# contributors may be used to endorse or promote products derived
13+
# from this software without specific prior written permission.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
16+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21+
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23+
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
27+
name: "CodeQL"
28+
29+
on:
30+
push:
31+
branches: [ 'main' ]
32+
pull_request:
33+
# The branches below must be a subset of the branches above
34+
branches: [ 'main' ]
35+
schedule:
36+
- cron: '0 1 * * 1-6'
37+
38+
jobs:
39+
analyze:
40+
name: Analyze
41+
runs-on: ubuntu-latest
42+
permissions:
43+
actions: read
44+
contents: read
45+
security-events: write
46+
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
language: [ 'python' ]
51+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
52+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
53+
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v3
57+
58+
# Initializes the CodeQL tools for scanning.
59+
- name: Initialize CodeQL
60+
uses: github/codeql-action/init@v2
61+
with:
62+
languages: ${{ matrix.language }}
63+
# If you wish to specify custom queries, you can do so here or in a config file.
64+
# By default, queries listed here will override any specified in a config file.
65+
# Prefix the list here with "+" to use these queries and those in the config file.
66+
67+
# Details on CodeQL's query packs refer to:
68+
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
69+
queries: +security-and-quality
70+
71+
72+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
73+
# If this step fails, then you should remove it and run the build manually (see below)
74+
- name: Autobuild
75+
uses: github/codeql-action/autobuild@v2
76+
77+
# Command-line programs to run using the OS shell.
78+
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79+
80+
# If the Autobuild fails above, remove it and uncomment the following three lines.
81+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
82+
83+
# - run: |
84+
# echo "Run, Build Application using script"
85+
# ./location_of_script_within_repo/buildscript.sh
86+
87+
- name: Perform CodeQL Analysis
88+
uses: github/codeql-action/analyze@v2
89+
with:
90+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)