From a85792a1624b8af9f884c5129106f596a407f27b Mon Sep 17 00:00:00 2001 From: Guillaume Fieni Date: Fri, 5 May 2023 15:26:16 +0200 Subject: [PATCH] ci(build): Add upload of coverage reports to Codecov --- .codecov.yml | 17 +++++++++++++++++ .github/workflows/build.yml | 6 ++++++ 2 files changed, 23 insertions(+) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..d32d311 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,17 @@ +coverage: + precision: 2 + round: down + range: "50...100" + status: + project: + default: + target: auto + threshold: 5% + patch: + default: + informational: true + +comment: + layout: "reach, diff, files" + behavior: default + require_changes: true \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3833b8..b489adb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,3 +41,9 @@ jobs: - name: Test with pytest run: | pytest --cov=smartwatts --cov-report=term --cov-report=xml tests/unit + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3.1.3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.xml