-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (41 loc) · 1.09 KB
/
python-checks.yaml
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
---
# This workflow will run the Black Python formatter as well as the
# Bandit security linter. See the following pages for details:
# See https://black.readthedocs.io/en/stable/github_actions.html
# https://github.com/PyCQA/bandit
name: Python-Checks
on:
push:
branches:
- main
paths:
- '**.py' # All python files in the repository
pull_request:
paths:
- '**.py'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: psf/black@stable
bandit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Scan
run: |
pip install -r requirements-dev.txt
bandit --exclude ./.venv/,./test -r .