Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update CI config to use pre-commit hooks
  • Loading branch information
JWCook committed Aug 30, 2021
1 parent 70654bc commit e2a755a
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/build.yml
Expand Up @@ -79,26 +79,22 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: ${{ env.LATEST_PY_VERSION }}
- name: Run style checks and linting via pre-commit hooks
uses: pre-commit/action@v2.0.3

# TODO: This section could be removed if the issues with the mypy pre-commit hook were resolved
- uses: snok/install-poetry@v1.1.8
with:
version: 1.2.0a2
virtualenvs-in-project: true

# Cache packages and reuse until lockfile changes
- name: Cache python packages
id: cache
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ env.LATEST_PY_VERSION }}-${{ hashFiles('poetry.lock') }}
key: venv-${{ matrix.python-version }}-latest-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: poetry install -v -E all

- name: Run style checks, type checks, and linting
run: |
source $VENV
black --check --diff .
isort --check --diff .
flake8 aiohttp_client_cache test
mypy .
- name: Run type checking
run: poetry run mypy --install-types --non-interactive .

0 comments on commit e2a755a

Please sign in to comment.