-
Notifications
You must be signed in to change notification settings - Fork 23
60 lines (50 loc) · 1.42 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
58
59
60
## 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'
- '.github/workflows/code_quality.yml'
pull_request:
paths:
- '**.py'
- '.github/workflows/code_quality.yml'
# 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-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[tests]
- name: Analyse the code with pylint
run: |
pylint --fail-under 8 narps_open > pylint_report_narps_open.txt
pylint --fail-under 8 tests > pylint_report_tests.txt
- name: Archive pylint results
uses: actions/upload-artifact@v3
if: failure() # Only if previous step failed
with:
name: pylint-reports-python
path: |
pylint_report_narps_open.txt
pylint_report_tests.txt
retention-days: 15