From fd6da335a51bcc485373230e482c6d6a706ebae5 Mon Sep 17 00:00:00 2001 From: mimir-d Date: Sun, 13 Oct 2024 16:01:15 +0100 Subject: [PATCH] add codecov.io coverage - remove prev manual coverage report Signed-off-by: mimir-d --- .github/codecov.yaml | 18 ++++++++++++++++++ .github/workflows/coverage.yaml | 25 ------------------------- .github/workflows/tests.yaml | 31 ++++++++++++++++++++++++++----- 3 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 .github/codecov.yaml delete mode 100644 .github/workflows/coverage.yaml diff --git a/.github/codecov.yaml b/.github/codecov.yaml new file mode 100644 index 0000000..a05c22f --- /dev/null +++ b/.github/codecov.yaml @@ -0,0 +1,18 @@ +# ref: https://docs.codecov.com/docs/codecovyml-reference +coverage: + range: 100 + round: down + precision: 1 + status: + # ref: https://docs.codecov.com/docs/commit-status + project: + default: + # Avoid false negatives + threshold: 1% + patch: + default: + informational: true + +comment: + layout: "condensed_header, files" + require_changes: true diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml deleted file mode 100644 index 0bfdb70..0000000 --- a/.github/workflows/coverage.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: coverage - -# only check for coverage on PRs -on: [pull_request] - -jobs: - coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install python 3.7 - uses: actions/setup-python@v4 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Test coverage with pytest - run: | - pytest -v --cov-fail-under=100 --cov-report "xml:coverage.xml" - - name: Pytest coverage comment - uses: MishaKav/pytest-coverage-comment@main - with: - pytest-xml-coverage-path: ./coverage.xml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index db6731a..2d0e39a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -22,14 +22,35 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt - name: Lint with black - run: | - black . --check --diff + run: black . --check --diff - name: Check typing with mypy - run: | - mypy . --check-untyped-defs + run: mypy . --check-untyped-defs - name: Test with pytest + run: pytest -v + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install dependencies run: | - pytest -v + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Lint with black + run: black . --check --diff + - name: Check typing with mypy + run: mypy . --check-untyped-defs + - name: Get pytest coverage + run: pytest --cov-fail-under=100 --cov-report xml + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} spec: runs-on: ubuntu-latest