Skip to content

Commit 50bdf7d

Browse files
committed
ci: Add bandit into our workflows.
1 parent e6ad101 commit 50bdf7d

4 files changed

Lines changed: 67 additions & 3 deletions

File tree

.github/workflows/branches.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,38 @@ jobs:
4646
- name: Lint with Pylint
4747
run: pylint PyFunceble
4848

49+
sec_check:
50+
name: Check the safety of the codebase with Bandit
51+
52+
runs-on: "${{ matrix.os }}"
53+
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
python_version:
58+
- "3.12"
59+
os:
60+
- ubuntu-latest
61+
62+
steps:
63+
- uses: actions/checkout@v6
64+
name: Clone repository
65+
66+
- name: Set up Python ${{ matrix.python_version }}
67+
uses: actions/setup-python@v6
68+
with:
69+
python-version: ${{ matrix.python_version }}
70+
71+
- name: Install dependencies
72+
run: |
73+
pip install --upgrade pip
74+
pip install .[test,dev]
75+
76+
- name: Check the safety of the codebase with Bandit
77+
run: bandit --ini=setup.cfg -r PyFunceble
78+
4979
test:
50-
needs: [lint]
80+
needs: [lint, sec_check]
5181
name: "[${{ matrix.os }}-py${{ matrix.python_version }}] Test Extension"
5282

5383
runs-on: "${{ matrix.os }}"

.github/workflows/main.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,38 @@ jobs:
4444
- name: Lint with Pylint
4545
run: pylint PyFunceble
4646

47+
sec_check:
48+
name: Check the safety of the codebase with Bandit
49+
50+
runs-on: "${{ matrix.os }}"
51+
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
python_version:
56+
- "3.12"
57+
os:
58+
- ubuntu-latest
59+
60+
steps:
61+
- uses: actions/checkout@v6
62+
name: Clone repository
63+
64+
- name: Set up Python ${{ matrix.python_version }}
65+
uses: actions/setup-python@v6
66+
with:
67+
python-version: ${{ matrix.python_version }}
68+
69+
- name: Install dependencies
70+
run: |
71+
pip install --upgrade pip
72+
pip install .[test,dev]
73+
74+
- name: Check the safety of the codebase with Bandit
75+
run: bandit --ini=setup.cfg -r PyFunceble
76+
4777
test:
48-
needs: [lint]
78+
needs: [lint, sec_check]
4979
name: "[${{ matrix.os }}-py${{ matrix.python_version }}] Test Extension"
5080

5181
runs-on: "${{ matrix.os }}"

requirements.dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
black
22
flake8
33
isort
4-
pylint
4+
pylint
5+
bandit

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ minversion = 6.0
2727
addopts = --cov=PyFunceble --cov-report=html --cov-report=term
2828
testpaths =
2929
tests
30+
31+
[bandit]
32+
exclude = tests

0 commit comments

Comments
 (0)