-
Notifications
You must be signed in to change notification settings - Fork 23
57 lines (47 loc) · 1.26 KB
/
code_quality.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
57
## Disclaimer - This GitHub Actions workflow performs a static analysis of the python code.
# Name the workflow
name: code_quality
# Define when it runs
on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'
# Jobs that define the workflow
jobs:
# Name of the job running pylint
pylint:
# Define the OS
runs-on: ubuntu-latest
# Steps that define the job
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-pylint
restore-keys: |
${{ runner.os }}-pip-pylint
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analyse the code with pylint
run: |
pylint --exit-zero narps_open > pylint_report_narps_open.txt
pylint --exit-zero tests > pylint_report_tests.txt
- name: Archive pylint results
uses: actions/upload-artifact@v3
with:
name: pylint-reports-python
path: |
pylint_report_narps_open.txt
pylint_report_tests.txt
retention-days: 15