Skip to content

Commit 84a6887

Browse files
[CI] Do Bandit scan only on Linux and move it to 'checks' workflow
1 parent daf2103 commit 84a6887

File tree

3 files changed

+12
-42
lines changed

3 files changed

+12
-42
lines changed

.github/workflows/bandit.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/pr_push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
CodeCheck:
19+
CodeChecks:
2020
uses: ./.github/workflows/reusable_checks.yml
2121
DocsBuild:
2222
uses: ./.github/workflows/reusable_docs_build.yml
2323
FastBuild:
2424
name: Fast builds
25-
needs: [CodeCheck, DocsBuild]
25+
needs: [CodeChecks, DocsBuild]
2626
uses: ./.github/workflows/reusable_fast.yml
2727
Build:
2828
name: Basic builds

.github/workflows/reusable_checks.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Basic checks on the code, incl. coding style and spelling.
1+
# Basic checks on the code, incl. coding style, spelling, bandit analysis.
22
# TODO: add license check
33
name: Basic checks
44

@@ -8,8 +8,8 @@ permissions:
88
contents: read
99

1010
jobs:
11-
CodeCheck:
12-
name: Coding style and spell check
11+
CodeChecks:
12+
name: Basic code checks
1313
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
1414

1515
steps:
@@ -18,10 +18,11 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020

21-
- name: Install apt packages
21+
- name: Install dependencies
2222
run: |
2323
sudo apt-get update
2424
sudo apt-get install -y black cmake clang-format-15 cmake-format libhwloc-dev
25+
python3 -m pip install bandit
2526
2627
- name: Configure CMake
2728
run: >
@@ -47,4 +48,8 @@ jobs:
4748
- name: Run a spell check
4849
uses: crate-ci/typos@b63f421581dce830bda2f597a678cb7776b41877 # v1.18.2
4950
with:
50-
config: ./.github/workflows/.spellcheck-conf.toml
51+
config: ./.github/workflows/.spellcheck-conf.toml
52+
53+
# Run Bandit recursively, but omit _deps directory (with 3rd party code)
54+
- name: Run Bandit
55+
run: python3 -m bandit -r . -x '/_deps/'

0 commit comments

Comments
 (0)