From e2a755a92674496a9d8416108a95a69f5bb823ca Mon Sep 17 00:00:00 2001 From: Jordan Cook Date: Mon, 30 Aug 2021 14:24:34 -0500 Subject: [PATCH] Update CI config to use pre-commit hooks --- .github/workflows/build.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 70035d2..b374a43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 . \ No newline at end of file