From e7ae41c460b147e336d4eefb277514defc7c70a2 Mon Sep 17 00:00:00 2001 From: phi Date: Sun, 15 Sep 2024 00:35:04 +0900 Subject: [PATCH] chore: prepare codecov --- .github/workflows/check.yaml | 6 ++++++ codecov.yml | 25 +++++++++++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 codecov.yml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 79390da..e3b6a3a 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -60,3 +60,9 @@ jobs: - name: Minimize uv cache run: uv cache prune --ci + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + if: matrix.python-version == '3.12' + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..7528c84 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,25 @@ +codecov: + require_ci_to_pass: true + allow_pseudo_compare: true + allow_coverage_offsets: true + +comment: + layout: "reach, diff, flags, files" + behavior: default + require_changes: false + require_base: false + require_head: false + +coverage: + range: 60..90 + round: down + precision: 0 + + status: + project: + default: + target: 80 + patch: + default: + target: auto + threshold: 5 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ec5597b..d42dd59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,7 @@ packages = ["src/timeout_executor"] include = ["src/timeout_executor"] [tool.pytest.ini_options] -addopts = "-n 4 --cov=src/timeout_executor --cov-report html" +addopts = "-n 4 --cov=src/timeout_executor --cov-report html --cov-report=xml" testpaths = ["src/tests"] [tool.coverage.report]