1
- name : " Pull Request"
1
+ name : " Pull Request"
2
2
3
3
on :
4
4
push :
22
22
23
23
steps :
24
24
- uses : actions/checkout@v4
25
+
25
26
- name : Test if changes are in not ignored paths
26
27
id : are-non-ignored-files-changed
27
28
uses : tj-actions/changed-files@v45
@@ -36,17 +37,20 @@ jobs:
36
37
README.md
37
38
mkdocs.yml
38
39
.backportrc.json
40
+
39
41
- name : Install poetry
40
42
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
41
43
run : |
42
44
python -m pip install --upgrade pip
43
45
pipx install poetry
46
+
44
47
- name : Set up Python ${{ matrix.python-version }}
45
48
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
46
49
uses : actions/setup-python@v5
47
50
with :
48
51
python-version : ${{ matrix.python-version }}
49
52
cache : " poetry"
53
+
50
54
- name : Install dependencies
51
55
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
52
56
run : |
@@ -57,44 +61,56 @@ jobs:
57
61
sed -E 's/.*"v([^"]+)".*/\1/' \
58
62
) && curl -L -o /tmp/hadolint "https://github.com/hadolint/hadolint/releases/download/v${VERSION}/hadolint-Linux-x86_64" \
59
63
&& chmod +x /tmp/hadolint
64
+
60
65
- name : Poetry check
61
66
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
62
67
run : |
63
68
poetry lock --check
69
+
64
70
- name : Lint with flake8
65
71
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
66
72
run : |
67
73
poetry run flake8 . --ignore=E266,W503,E203,E501,W605,E128 --exclude contrib,ui,api
74
+
68
75
- name : Checking format with black
69
76
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
70
77
run : |
71
78
poetry run black --exclude api ui --check .
79
+
72
80
- name : Lint with pylint
73
81
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
74
82
run : |
75
83
poetry run pylint --disable=W,C,R,E -j 0 -rn -sn prowler/
84
+
76
85
- name : Bandit
77
86
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
78
87
run : |
79
88
poetry run bandit -q -lll -x '*_test.py,./contrib/,./api/,./ui' -r .
89
+
80
90
- name : Safety
81
91
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
82
92
run : |
83
93
poetry run safety check --ignore 70612 -r pyproject.toml
94
+
84
95
- name : Vulture
85
96
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
86
97
run : |
87
98
poetry run vulture --exclude "contrib,api,ui" --min-confidence 100 .
99
+
88
100
- name : Hadolint
89
101
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
90
102
run : |
91
103
/tmp/hadolint Dockerfile --ignore=DL3013
104
+
92
105
- name : Test with pytest
93
106
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
94
107
run : |
95
108
poetry run pytest -n auto --cov=./prowler --cov-report=xml tests
109
+
96
110
- name : Upload coverage reports to Codecov
97
111
if : steps.are-non-ignored-files-changed.outputs.any_changed == 'true'
98
112
uses : codecov/codecov-action@v5
99
113
env :
100
114
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
115
+ with :
116
+ flags : prowler
0 commit comments