-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (46 loc) · 1.51 KB
/
python.yml
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
name: Python tests
on:
workflow_dispatch:
push:
paths:
- "**/*.py"
- ".github/workflows/python.yml"
jobs:
python_tests:
name: Python tests
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up Python 3.11 # update to 3.12 once Prospector includes Pylint v3.x
uses: actions/setup-python@v5 # update to 3.12 once Prospector includes Pylint v3.x
with:
python-version: "3.11"
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
pip install -r tests/requirements-dev.txt
- name: Black
run: |
black --check --line-length 120 .
- name: Prospector
run: |
prospector
- name: prepare reports dir
run: mkdir --parents ${{runner.temp}}/reports_sast_python/
- name: generate json report
run: >
bandit -r modules/terraform-aws-ca-lambda/lambda_code modules/terraform-aws-ca-lambda/utils scripts tests
--exit-zero
--ini .config/sast_python_bandit_json.yml
1> ${{runner.temp}}/reports_sast_python/${RANDOM}.json
- name: save json report
uses: actions/upload-artifact@v4
with:
name: sast_python
if-no-files-found: error
path: ${{runner.temp}}/reports_sast_python/
- name: Bandit
run: >
bandit -r src --ini .config/sast_python_bandit_cli.yml