diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..f3ee8ebcf --- /dev/null +++ b/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True +source = vulnerablecode + +[report] +exclude_lines = + if self.debug: + pragma: no cover + raise NotImplementedError + if __name__ == .__main__.: +ignore_errors = True +omit = + tests/* \ No newline at end of file diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 000000000..42a7d8e28 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,2 @@ +service_name: travis-pro +repo_token: O8pGVG8t4c9FMEkiWAwP3WyuJnXmGyNTr diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d05b5f0ba..04db34a6d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,3 +46,8 @@ jobs: POSTGRES_PORT: 5432 DJANGO_DEV: 1 GH_TOKEN: 1 + + - name: "Upload coverage to Codecov" + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index e47738ee8..bd6f45263 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,3 +28,8 @@ notifications: on_success: change # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: never # options: [always|never|change] default: always + +language: + python +after_success: + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/README.rst b/README.rst index a7eb1b033..a0b8267d1 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ VulnerableCode ============== -|Build Status| |License| |Python 3.8| |stability-wip| |Gitter chat| +|Build Status| |License| |Python 3.8| |stability-wip| |Gitter chat| |Coverage| .. |Build Status| image:: https://github.com/nexB/vulnerablecode/workflows/CI/badge.svg @@ -13,6 +13,9 @@ VulnerableCode .. |stability-wip| image:: https://img.shields.io/badge/stability-work_in_progress-lightgrey.svg .. |Gitter chat| image:: https://badges.gitter.im/gitterHQ/gitter.png :target: https://gitter.im/aboutcode-org/vulnerablecode +.. |Coverage| image:: https://coveralls.io/repos/github/anshsrtv/vulnerablecode/badge.svg?branch=main + :target: https://coveralls.io/github/anshsrtv/vulnerablecode?branch=main + VulnerableCode is a free and open database of FOSS software package diff --git a/requirements.txt b/requirements.txt index 757246715..a7f34f262 100644 --- a/requirements.txt +++ b/requirements.txt @@ -37,6 +37,7 @@ pygit2==1.5.0 Pygments==2.7.4 pyparsing==2.4.5 pytest==6.2.3 +python-coveralls==2.9.2 pytest-django==4.1.0 django-widget-tweaks==1.4.8 pytest-dependency==0.4.0 @@ -56,4 +57,4 @@ zipp==0.6.0 requests==2.23.0 toml==0.10.2 PyYAML==5.4 -freezegun==1.1.0 \ No newline at end of file +freezegun==1.1.0