From 376f8a01748a21dd7794c4f16bb017a3507f5685 Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Thu, 25 Jun 2020 20:35:41 +0300 Subject: [PATCH 01/14] refactor(ci): refactor test running Signed-off-by: Sergey Kastryulin --- .github/workflows/ci-testing.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 362cb438..98bf789e 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -34,11 +34,12 @@ 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 From a3bba81819be473ba073c6eb1836b3366d8c084a Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Thu, 25 Jun 2020 20:44:37 +0300 Subject: [PATCH 02/14] refactor(ci): fix changed installation of packages Signed-off-by: Sergey Kastryulin --- .github/workflows/ci-testing.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 98bf789e..45fc5fdb 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -34,11 +34,11 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install pytest, \ - pytest-cov, \ - tensorflow, \ - libsvm, \ - pybrisque, \ + pip install pytest \ + pytest-cov \ + tensorflow \ + libsvm \ + pybrisque \ scikit-image - name: Test with pytest run: | From 36ec9093f81838ddaf694a836b6f422285f81a58 Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Thu, 25 Jun 2020 20:50:12 +0300 Subject: [PATCH 03/14] chore(ci): add integration with codecov Signed-off-by: Sergey Kastryulin --- .github/workflows/ci-testing.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 45fc5fdb..d284c451 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -42,4 +42,12 @@ jobs: scikit-image - name: Test with pytest run: | - pytest + pytest -x --cov=./ --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true From 824bea30c9b9fcf72a0b5eaf635275e1fc7b137c Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Thu, 25 Jun 2020 23:26:27 +0300 Subject: [PATCH 04/14] chore(readme): codecov shield Signed-off-by: Sergey Kastryulin --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 54df6a50..26ad33dc 100644 --- a/README.md +++ b/README.md @@ -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] @@ -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 \ No newline at end of file From 06f1e9f7ab68bcea7cd434b6de6568e9413cd3da Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Thu, 25 Jun 2020 23:31:47 +0300 Subject: [PATCH 05/14] chore(general): add codecov configuration Signed-off-by: Sergey Kastryulin --- codecov.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..53cf2d22 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +comment: + layout: "reach, diff, flags, files" + behavior: default + 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: yes # [yes :: must have a head report to post] + branches: # branch names that can post comment + - "master" From 643484546d0a7a86f02a18eb6cc6fd69ec0405c6 Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Thu, 25 Jun 2020 23:42:22 +0300 Subject: [PATCH 06/14] chore(general): update codecov configuration Signed-off-by: Sergey Kastryulin --- codecov.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/codecov.yml b/codecov.yml index 53cf2d22..69db979d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,19 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + comment: layout: "reach, diff, flags, files" behavior: default From f4d55880e7070b82e1cac38030b4ccd10d79e424 Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Fri, 26 Jun 2020 19:45:32 +0300 Subject: [PATCH 07/14] chore(general): update codecov configuration Signed-off-by: Sergey Kastryulin --- codecov.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/codecov.yml b/codecov.yml index 69db979d..9553fe76 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,9 +2,23 @@ codecov: require_ci_to_pass: yes coverage: - precision: 2 - round: down - range: "70...100" + 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: From 1d033af648f84cf0b293a052be8a3cd10b15c0a0 Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Fri, 26 Jun 2020 19:57:55 +0300 Subject: [PATCH 08/14] chore(general): update codecov configuration Signed-off-by: Sergey Kastryulin --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 9553fe76..d29b7279 100644 --- a/codecov.yml +++ b/codecov.yml @@ -33,6 +33,6 @@ comment: behavior: default 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: yes # [yes :: must have a head report to post] + require_head: no # [yes :: must have a head report to post] branches: # branch names that can post comment - "master" From 091b0055e5699bca2b391299e1442bed4b26b904 Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Mon, 29 Jun 2020 22:01:19 +0300 Subject: [PATCH 09/14] Update codecov.yml Co-authored-by: Denis Prokopenko <22414094+denproc@users.noreply.github.com> --- codecov.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/codecov.yml b/codecov.yml index d29b7279..f9a77b87 100644 --- a/codecov.yml +++ b/codecov.yml @@ -34,5 +34,3 @@ comment: 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] - branches: # branch names that can post comment - - "master" From 7f1602b67fe048425f4f72fa71db9cba4bca7abb Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Mon, 29 Jun 2020 22:01:56 +0300 Subject: [PATCH 10/14] Update codecov.yml Co-authored-by: Denis Prokopenko <22414094+denproc@users.noreply.github.com> --- codecov.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/codecov.yml b/codecov.yml index f9a77b87..b9b73c86 100644 --- a/codecov.yml +++ b/codecov.yml @@ -12,8 +12,6 @@ coverage: flags: - unit # advanced - branches: - - master if_not_found: success if_ci_failed: error informational: false From 2e5576dc6f3e61fc10e89ed133242e3d9114c28a Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Mon, 29 Jun 2020 22:08:44 +0300 Subject: [PATCH 11/14] Update .github/workflows/ci-testing.yml Co-authored-by: Denis Prokopenko <22414094+denproc@users.noreply.github.com> --- .github/workflows/ci-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index d284c451..deb9d005 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -42,7 +42,7 @@ jobs: scikit-image - name: Test with pytest run: | - pytest -x --cov=./ --cov-report=xml + pytest -x --cov=./piq --cov-report=xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: From 80d7bad59bf569825d315fcfbf84aa547fc2b271 Mon Sep 17 00:00:00 2001 From: Denis Prokopenko <22414094+denproc@users.noreply.github.com> Date: Mon, 29 Jun 2020 22:54:20 +0300 Subject: [PATCH 12/14] Update codecov.yml --- codecov.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codecov.yml b/codecov.yml index b9b73c86..2b3ed867 100644 --- a/codecov.yml +++ b/codecov.yml @@ -12,6 +12,7 @@ coverage: flags: - unit # advanced + branches: master if_not_found: success if_ci_failed: error informational: false @@ -29,6 +30,7 @@ parsers: 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] From 91ce3cf9fb91c1fcc700fa4841b0be48c4e7ea48 Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Tue, 30 Jun 2020 20:49:46 +0300 Subject: [PATCH 13/14] chore(ci): upload codecov reports only for a single python version Signed-off-by: Sergey Kastryulin --- .github/workflows/ci-testing.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index deb9d005..943d2ae1 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -46,6 +46,8 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: + # Upload codecov reports only from a pipeline for a single version + python-version: 3.6 token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml flags: unittests From 67f10204531b7eb03bd8f60968733ea3fde05b2b Mon Sep 17 00:00:00 2001 From: Sergey Kastryulin Date: Tue, 30 Jun 2020 21:14:37 +0300 Subject: [PATCH 14/14] chore(ci): upload codecov reports only for a single python version Signed-off-by: Sergey Kastryulin --- .github/workflows/ci-testing.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 943d2ae1..a31d1182 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -10,6 +10,9 @@ jobs: build: runs-on: ubuntu-latest + env: + USING_COVERAGE: '3.6' + strategy: max-parallel: 4 matrix: @@ -44,10 +47,10 @@ jobs: run: | 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: - # Upload codecov reports only from a pipeline for a single version - python-version: 3.6 token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml flags: unittests