.github/workflows/lint-check.yml
name: Lint
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# Caching Linux
- uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# Setup
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
# Install Dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8==3.8.3 pytest black==20.8b1 isort==5.4.2 codecov pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint check
run: |
flake8 .
black --check .
isort --profile black -c .