Skip to content

Commit

Permalink
Split lint to separate step
Browse files Browse the repository at this point in the history
  • Loading branch information
shosca committed Jun 15, 2022
1 parent 1710fdb commit 0b17a46
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Build

on:
pull_request:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
build:
Expand All @@ -24,6 +23,8 @@ jobs:
strategy:
matrix:
container:
- image: python:latest
toxenv: lint
- image: python:3.6
toxenv: py36-sqla12
- image: python:3.6
Expand Down Expand Up @@ -76,6 +77,7 @@ jobs:
env:
DATABASE_URL: postgresql://postgres:postgres@postgres
- name: Upload Coverage
if: "!startsWith('lint', matrix.container.toxenv)"
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ clean-test: ## remove test and coverage artifacts
resetdb: $(RESETDBS)

lint: ## run pre-commit hooks on all files
-if python -c "import sys; exit(1) if (sys.version_info.major, sys.version_info.minor) < (3, 7) else exit(0)"; then \
pre-commit run --all-files ; \
fi
pre-commit run --all-files

coverage: ## check code coverage quickly with the default Python
py.test $(PYTEST_OPTS) \
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
- pg
environment:
- DATABASE_URL=postgresql://postgres:postgres@pg
- TOX_WORK_DIR=/tmp/tox
volumes:
- .:/code
- /tmp:/root/.cache
9 changes: 8 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[tox]
toxworkdir={env:TOX_WORK_DIR:.tox}
skipsdist = true
envlist =
lint
pypy36-{drf38,drf39,drf310}-{sqla12,sqla13,sqla14}-{dj11,dj20,dj21,dj22}-

py36-{sqla12,sqla13,sqla14}-{ drf38}-{dj11,dj20,dj21,dj22 }
Expand Down Expand Up @@ -77,4 +79,9 @@ whitelist_externals =
commands =
pip freeze
make resetdb
make -j lint coverage
make coverage

[testenv:lint]
basepython = python3.10
commands =
make lint

0 comments on commit 0b17a46

Please sign in to comment.