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

Codecov and codeclimate report upload added #29

Merged
merged 6 commits into from
May 22, 2020
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
13 changes: 12 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,16 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install nox
- name: Run nox
- name: Run pytest tests with nox
run: nox -s tests-${{ matrix.python }}
- name: Send coverage report to codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
- name: Send coverage report to codeclimate
uses: paambaati/codeclimate-action@v2.6.0
with:
coverageCommand: echo "Ignore rerun"
coverageLocations: ${{github.workspace}}/coverage.xml:coverage.py
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v3.1.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
Expand All @@ -23,7 +23,7 @@ repos:
args:
- --markdown-linebreak-ext=md
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
rev: 3.8.1
hooks:
- id: flake8
additional_dependencies:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
[![python](https://img.shields.io/pypi/pyversions/ikt.svg)](https://pypi.python.org/pypi/ikt)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/insspb/ikt/Run%20checks/master)](https://github.com/insspb/ikt)
[![docs](https://readthedocs.org/projects/ikt/badge/?version=latest)](https://ikt.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/insspb/ikt/branch/master/graph/badge.svg)](https://codecov.io/gh/insspb/ikt)
[![Test Coverage](https://api.codeclimate.com/v1/badges/792c94611eaba16a8dc5/test_coverage)](https://codeclimate.com/github/insspb/ikt/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/792c94611eaba16a8dc5/maintainability)](https://codeclimate.com/github/insspb/ikt/maintainability)
[![Code Qaulity](https://img.shields.io/scrutinizer/g/insspb/ikt.svg)](https://scrutinizer-ci.com/g/insspb/ikt/?branch=master)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Expand Down
18 changes: 10 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@
nox.options.keywords = "not docs"


def base_install(session):
"""Creates basic environment setup for tests and linting."""
session.install("-r", "requirements.txt")
session.install("-e", ".")
return session


@nox.session(python=["3.7", "3.8"])
def tests(session):
"""Run test suite with pytest."""
session.install("-r", "requirements.txt")
session.install("-e", ".")
if session.python == "3.8":
session.run("pytest", "--cov-report=html")
else:
session.run("pytest")
session = base_install(session)
session.run("pytest", "--cov-report=html", "--cov-report=xml")


@nox.session(python="3.8")
def linting(session):
"""Launch linting locally."""
session.install("-r", "requirements.txt")
session.install("-e", ".")
session = base_install(session)
session.run("pre-commit", "run", "-a")


Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ flake8-docstrings>=1.5.0
# Testing
pytest>=5.4.0
pytest-cov>=2.8.0

# Development
nox>=2019.11.9
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[flake8]
ignore = E231, W503
ignore = E231, W503, D401

# Excludes due to known issues or incompatibilities with black:
# W503: https://github.com/psf/black/search?q=W503&unscoped_q=W503
# E231: https://github.com/psf/black/issues/1202
# D401: First line should be in imperative mood; try rephrasing

statistics = 1
# black official is 88
Expand Down