Added caching dependencies and black validation

This commit is contained in:
Alex Root Junior 2021-05-12 23:23:34 +03:00
parent 55861cb50d
commit 74bd34b1a5

View file

@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 6
fail-fast: false
fail-fast: true
matrix:
os:
- ubuntu-latest
@ -35,18 +35,30 @@ jobs:
- name: Install and configure Poetry
uses: snok/install-poetry@v1.1.4
with:
virtualenvs-create: false
virtualenvs-in-project: false
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Project dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install
poetry install --no-interaction
- name: Lint code
run: |
poetry run flake8 aiogram
poetry run mypy aiogram
- name: Check code-style (Black)
run: |
poetry run black --check --diff aiogram tests
- name: Run tests
run: |
poetry run pytest --cov=aiogram --cov-config .coveragerc --cov-report=xml