Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run code qual and tests in gha #147

Merged
merged 4 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/actions/setup-python-build-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ runs:
python -m pip install --upgrade pip
- name: Install Poetry
shell: bash
run: |
pip install --user poetry
pip install "mypy==0.910"
run: pip install --user poetry
23 changes: 18 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,21 @@ jobs:
run: |
cp .env.dev.local .env

- name: Code Quality Check
shell: bash
run: |
cp template.Dockerfile iso15118/secc/Dockerfile
docker-compose build secc
- name: Install dependencies
run: make install-local

# TODO: Fix MyPy issues https://github.com/SwitchEV/iso15118/issues/93
# - name: Mypy
# run: make mypy

- name: Black
run: make black

- name: Flake8
run: make flake8

- name: isort
run: make isort

- name: Tests
run: make test
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,27 @@ test-secc:

# Run pytest
test:
pytest tests
poetry run pytest -vv --cov-config .coveragerc --cov-report term-missing --durations=3 --cov=.

# Run mypy checks
mypy:
mypy --config-file mypy.ini iso15118 tests
poetry run mypy --config-file mypy.ini iso15118 tests

# Reformat with isort and black
reformat:
isort iso15118 tests && black --line-length=88 iso15118 tests
poetry run isort iso15118 tests && poetry run black --line-length=88 iso15118 tests

# Run black checks
black:
black --check --diff --line-length=88 iso15118 tests
poetry run black --check --diff --line-length=88 iso15118 tests

# Run isort checks
isort:
poetry run isort --check-only iso15118 tests

# Run flake8 checks
flake8:
flake8 --config .flake8 iso15118 tests
poetry run flake8 --config .flake8 iso15118 tests

# Run black, isort, mypy, & flake8
code-quality: reformat mypy flake8
Expand Down
46 changes: 45 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ pytest-cov = "^3.0.0"
aiofile = "^3.7.4"
toml = "0.10.2"

[tool.poetry.group.dev.dependencies]
mypy = "^0.982"

[tool.isort]
profile = "black"

Expand Down