summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2021-08-08 18:10:45 -0500
committerJordan Cook <jordan.cook@pioneer.com>2021-08-08 18:21:24 -0500
commit6e40740083889bcc0cb8b5b22e4afa2138fc2ae8 (patch)
tree6850d98c70917f5ab08828bdfe7c43258bec6ff1 /.github/workflows
parent0239c0372ea5ad44807a8a47598d0b4dacff276b (diff)
downloadrequests-cache-6e40740083889bcc0cb8b5b22e4afa2138fc2ae8.tar.gz
Add more checks to pre-commit config, and reuse for both CI and local usage
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml27
1 files changed, 2 insertions, 25 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f7ce1f1..22df0d0 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -87,7 +87,7 @@ jobs:
coveralls --service=github
- # Run code analysis checks
+ # Run code analysis checks via pre-commit hooks
analyze:
runs-on: ubuntu-18.04
steps:
@@ -95,28 +95,5 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: ${{ env.LATEST_PY_VERSION }}
- - uses: snok/install-poetry@v1.1.7
- 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 }}-latest-${{ hashFiles('poetry.lock') }}
- - name: Install dependencies
- if: steps.cache.outputs.cache-hit != 'true'
- run: poetry install -v -E all
-
- name: Run style checks & linting
- run: |
- source $VENV
- black --check --diff .
- isort --check --diff .
- flake8 .
- mypy --install-types --non-interactive requests_cache
- - name: Run cyclomatic complexity check
- run: poetry run radon cc ${{ env.COMPLEXITY_ARGS }} requests_cache
+ uses: pre-commit/action@v2.0.3