File: bindings-sysman-python-security-scan.yml

package info (click to toggle)
level-zero 1.28.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,308 kB
  • sloc: cpp: 149,246; ansic: 16,655; python: 12,807; makefile: 5
file content (60 lines) | stat: -rw-r--r-- 1,277 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
##
# Copyright (C) 2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
##

name: Python Bindings - Security Scan

on:
  pull_request:
    branches:
      - '**'
    paths:
      - 'bindings/sysman/python/**'
  push:
    branches:
      - main
      - master
      - python_bindings
    paths:
      - 'bindings/sysman/python/**'
  workflow_dispatch:

jobs:
  bandit:
    name: Bandit Security Analysis
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: bindings/sysman/python
    permissions:
      contents: read
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.x'
      
      - name: Install Bandit
        run: |
          python -m pip install --upgrade pip
          pip install bandit
      
      - name: Run Bandit security scan
        run: |
          bandit -r source/ test/ -f json -o bandit-report.json
          bandit -r source/ test/ -ll -f screen
      
      - name: Upload Bandit results as artifact
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: bandit-security-report
          path: bandit-report.json
          retention-days: 30