-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.61 KB
/
pylint.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
name: Pylint
on:
push:
branches:
- '**' # matches every branch
- '!badges' # excludes master
paths:
- pi_server/**
- pylintrc
- .github/workflows/**
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint anybadge pdoc
pip install -r pi_server/requirements.txt
- name: create pylint badge
run: |
pylint --disable W1510 pi_server/ | tee pylint.txt
score=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.txt)
anybadge -l pylint -v $score -f pylint.svg 2=red 4=orange 9=yellow 10=green
- name: check linting
id: linting
run: |
pylint --disable W1510 pi_server/ --fail-under 8
continue-on-error: true
- name: create documentation
run: |
pdoc -o docs/python_p2p_connector pi_server/p2p_connector
- name: Archive code coverage results
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: update pylint badge
branch: badges
commit_options: '--no-verify --signoff'
create_branch: true
push_options: '--force'
- name: Check on failures
if: steps.linting.outcome != 'success'
run: exit 1