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

Test coverate info #116

Merged
merged 14 commits into from
Jul 1, 2020
Merged
26 changes: 20 additions & 6 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
build:

runs-on: ubuntu-latest
env:
USING_COVERAGE: '3.6'

strategy:
max-parallel: 4
matrix:
Expand All @@ -34,11 +37,22 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest \
pytest-cov \
tensorflow \
libsvm \
pybrisque \
scikit-image
- name: Test with pytest
run: |
pip install pytest
pip install tensorflow
pip install libsvm
pip install pybrisque
pip install scikit-image
pytest
pytest -x --cov=./piq --cov-report=xml
- name: Upload coverage to Codecov
# Upload codecov reports only from a pipeline for a single version defined in the env variable
if: "contains(env.USING_COVERAGE, matrix.python-version)"
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
[![License][license-shield]][license-url]
[![PyPI version][pypi-version-shield]][pypi-version-url]
![CI flake-8 style check][ci-flake-8-style-check-shield]
![CI testing][ci-testing]
![CI testing][ci-testing]
[![codecov][codecov-shield]][codecov-url]
[![Quality Gate Status][quality-gate-status-shield]][quality-gate-status-url]
[![Maintainability Rating][maintainability-raiting-shield]][maintainability-raiting-url]
[![Reliability Rating][reliability-rating-badge]][reliability-rating-url]
Expand Down Expand Up @@ -479,3 +480,5 @@ Other projects by PhotoSynthesis Team:
[maintainability-raiting-url]: https://sonarcloud.io/dashboard?id=photosynthesis-team_photosynthesis.metrics
[reliability-rating-badge]: https://sonarcloud.io/api/project_badges/measure?project=photosynthesis-team_photosynthesis.metrics&metric=reliability_rating
[reliability-rating-url]:https://sonarcloud.io/dashboard?id=photosynthesis-team_photosynthesis.metrics
[codecov-shield]:https://codecov.io/gh/photosynthesis-team/piq/branch/master/graph/badge.svg
[codecov-url]:https://codecov.io/gh/photosynthesis-team/piq
36 changes: 36 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
codecov:
require_ci_to_pass: yes

coverage:
status:
project:
default:
# basic
target: auto
threshold: 5%
base: auto
flags:
- unit
# advanced
branches: master
if_not_found: success
if_ci_failed: error
informational: false
only_pulls: false


parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach, diff, flags, files"
behavior: default
branches: *
require_changes: false # if true: only post the comment if coverage changes
require_base: no # [yes :: must have a base report to post]
require_head: no # [yes :: must have a head report to post]