-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.23 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
name: Python Linting and Formatting
on:
push:
branches: [main]
# Only on these paths so that something like a README update doesn't trigger it
paths:
- "**.py"
- ".github/workflows/lint.yml"
pull_request:
paths:
- "**.py"
- ".github/workflows/lint.yml"
workflow_dispatch:
# Cancel existing executions when new commits are pushed onto the branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-format:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python (and Cache CI dependencies)
uses: actions/setup-python@v3
with:
python-version: "3.7"
- name: Upgrade pip, install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_ci.txt
- name: Check with isort
run: |
isort . --check --diff
- name: Check with black
run: |
black . --check
- name: Check with flake8
run: |
flake8 .
- name: Check with mypy
run: |
mypy .