-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (58 loc) · 1.87 KB
/
lint.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
name: Lint
on:
push:
paths:
- '**requirements.txt'
- '**.py'
- '.flake8'
- '.pylintrc'
- '**.yml'
pull_request:
paths:
- '**requirements.txt'
- '**.py'
- '.flake8'
- '.pylintrc'
- '**.yml'
jobs:
Flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install flake8
run: pip install flake8
- name: Run flake8
uses: suo/flake8-github-action@releases/v1
with:
checkName: 'Flake8' # NOTE: this needs to be the same as the job name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install Pylint
run: pip install pylint pylint-exit
- name: Install Requirements
run: pip install -r requirements.txt
- name: Enable Matcher
run: echo "::add-matcher::./.github/problem-matchers/pylint-problem-matcher.json"
- name: Run Pylint
run: |
python -m tools.pylint \
--jobs 1 \
--reports=y \
--persistent=n \
--rcfile=.pylintrc \
-f tools.pylint.githubreporter.GithubReporter \
bot || pylint-exit --error-fail $?
- name: Disable Matcher
run: echo "::remove-matcher owner=pylint::"