Skip to content

Improve cuda_bindings examples #2914

Improve cuda_bindings examples

Improve cuda_bindings examples #2914

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
name: "Static Analysis: Bandit Scan"
on:
push:
branches:
- "pull-request/[0-9]+"
- "main"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
analyze:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
with:
enable-cache: false
- name: Get ignore codes
id: ignore-codes
# This are computed so that we can run only the `S` (bandit)
# checks. Passing --select to ruff overrides any config files
# (ruff.toml, pyproject.toml, etc), so to avoid having keep everything
# in sync we grab them from the TOML programmatically
run: |
set -euxo pipefail
echo "codes=$(uvx toml2json ./ruff.toml | jq -r '.lint.ignore | map(select(test("^S\\d+"))) | join(",")')" >> "$GITHUB_OUTPUT"
- name: Perform Bandit Analysis using Ruff
uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1
with:
args: "check --select S --ignore ${{ steps.ignore-codes.outputs.codes }} --output-format sarif --output-file results.sarif"
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v4.32.5
with:
sarif_file: results.sarif