From dd5d4f3c8b58db895f05f58b56b715b91bc035fb Mon Sep 17 00:00:00 2001 From: Jingxiang Zhang Date: Thu, 30 Jul 2026 09:47:11 -0700 Subject: [PATCH] chore(ci): add CodeQL analysis Signed-off-by: Jingxiang Zhang --- .github/workflows/codeql.yml | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..c1cc613 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,60 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +name: CodeQL + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: "23 9 * * 1" + workflow_dispatch: + +permissions: + actions: read + contents: read + security-events: write + +env: + GO_VERSION: "1.26.5" + +jobs: + codeql: + name: CodeQL Analysis + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + cache: true + + - name: Download dependencies + run: go mod download + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: go + build-mode: manual + env: + CODEQL_EXTRACTOR_GO_BUILD_TRACING: "on" + + - name: Build with CodeQL + run: go build ./... + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:go"