-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (50 loc) · 1.35 KB
/
python-linters.yml
File metadata and controls
52 lines (50 loc) · 1.35 KB
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
name: Python linters
on:
push:
pull_request:
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install APT dependencies
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Pip packages
run: |
python -m pip install -U pip wheel
pip install --requirement requirements.txt
- name: Flake8
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: flake8
run: flake8 .
- name: MyPy
if: always()
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: mypy
run: mypy --show-column-numbers .
- name: isort
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: isort
run: isort --check .
- name: Black
run: |
black --check .