Skip to content

Commit

Permalink
add lint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TColl committed Jan 13, 2022
1 parent 3536541 commit d659efd
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: lint

on: [push, merge]

jobs:
lint:
name: Run linting tools
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
python-version: "3.9"

- name: Permacache Poetry
id: cache-poetry
uses: actions/cache@v2.1.6
with:
path: ~/.poetry
key: poetry

- name: Install latest version of Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
- name: Add Poetry to $PATH
run: |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Get Poetry version
run: poetry --version

- name: Check pyproject.toml validity
run: poetry check --no-interaction

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v2.1.6
with:
path: ${{github.workspace}}/.venv
key: poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: poetry-

- name: Install deps
if: steps.cache-deps.cache-hit != 'true'
run: |
poetry config virtualenvs.in-project true
poetry install --no-interaction
- name: Lint code
run: |
poetry run pylint --errors-only hooks
poetry run flake8 hooks
poetry run isort --check hooks
poetry run black --check --diff .
poetry run mypy hooks

0 comments on commit d659efd

Please sign in to comment.