2020-06-27 01:38:25 +00:00
|
|
|
name: "Check Code Format"
|
2020-09-10 22:38:29 +00:00
|
|
|
|
|
|
|
on: # Trigger the workflow on push or pull request, but only for the master branch
|
2020-06-12 18:37:52 +00:00
|
|
|
push:
|
2021-01-12 12:56:20 +00:00
|
|
|
branches: [master, "release/*"]
|
2020-06-12 18:37:52 +00:00
|
|
|
pull_request:
|
2020-11-04 09:08:37 +00:00
|
|
|
branches: [master, "release/*"]
|
2020-06-03 16:23:14 +00:00
|
|
|
|
|
|
|
jobs:
|
2020-11-13 21:57:46 +00:00
|
|
|
imports-check-isort:
|
|
|
|
name: Check valid import formatting with isort
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Python 3.8
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
- name: Install isort
|
|
|
|
run: pip install isort==5.6.4
|
|
|
|
- name: Run isort
|
|
|
|
run: isort --settings-path=./pyproject.toml --check-only --diff .
|
|
|
|
|
2020-12-09 02:57:11 +00:00
|
|
|
#code-black:
|
|
|
|
# name: Check code formatting with Black
|
|
|
|
# runs-on: ubuntu-20.04
|
|
|
|
# steps:
|
|
|
|
# - name: Checkout
|
|
|
|
# uses: actions/checkout@v2
|
|
|
|
# - name: Set up Python 3.8
|
|
|
|
# uses: actions/setup-python@v2
|
|
|
|
# with:
|
|
|
|
# python-version: 3.8
|
|
|
|
# - name: Install Black
|
|
|
|
# run: pip install black==19.10b0
|
|
|
|
# - name: Run Black
|
|
|
|
# run: echo "LGTM"
|
|
|
|
# run black --skip-string-normalization --config=pyproject.toml --check . # TODO, uncomment
|
2020-06-27 01:38:25 +00:00
|
|
|
|
2020-12-09 02:57:11 +00:00
|
|
|
python-pep8:
|
|
|
|
name: Python formatting PEP8
|
2020-10-19 20:20:17 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2020-06-27 01:38:25 +00:00
|
|
|
|
|
|
|
# Timeout: https://stackoverflow.com/a/59076067/4521646
|
2020-12-09 02:57:11 +00:00
|
|
|
timeout-minutes: 10
|
2020-06-27 01:38:25 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2020-12-09 02:57:11 +00:00
|
|
|
pip install flake8
|
2020-06-27 01:38:25 +00:00
|
|
|
|
2020-12-09 02:57:11 +00:00
|
|
|
- name: Run checking
|
2020-06-27 01:38:25 +00:00
|
|
|
run: |
|
2020-12-09 02:57:11 +00:00
|
|
|
flake8 .
|
2020-10-19 20:20:17 +00:00
|
|
|
|
2020-12-09 02:57:11 +00:00
|
|
|
python-typing-mypy:
|
|
|
|
name: Python typing check [mypy]
|
2020-10-19 20:20:17 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2020-12-09 02:57:11 +00:00
|
|
|
- uses: actions/checkout@master
|
2020-10-19 20:20:17 +00:00
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
2020-12-09 02:57:11 +00:00
|
|
|
python-version: 3.8
|
|
|
|
- name: Install mypy
|
2020-10-19 20:20:17 +00:00
|
|
|
run: |
|
2021-01-25 01:09:08 +00:00
|
|
|
pip install "mypy==0.790"
|
2020-12-09 02:57:11 +00:00
|
|
|
pip list
|
|
|
|
- name: mypy check
|
2020-10-19 20:20:17 +00:00
|
|
|
run: |
|
2020-12-09 02:57:11 +00:00
|
|
|
mypy
|