Skip to content

Commit

Permalink
ci: Use codecov-action v4 (#972)
Browse files Browse the repository at this point in the history
* ci: Use codecov-action v4

* Upload unit and integration coverage with separate flags

* [pre-commit.ci] auto fixes

* Update threshold

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
edgarrmondragon and pre-commit-ci[bot] authored Sep 15, 2023
1 parent bc7f88a commit ba9f56a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental || false }}
env:
COVERAGE_FILE: ".coverage.unit"
NOXSESSION: "${{ matrix.session }}"
NOXFORCEPYTHON: "${{ matrix.python-version }}"
strategy:
Expand Down Expand Up @@ -144,7 +145,7 @@ jobs:
if: always() && matrix.session == 'tests'
uses: actions/[email protected]
with:
name: coverage-data
name: coverage-unit
path: ".coverage.*"

docker_tags:
Expand All @@ -167,6 +168,7 @@ jobs:
continue-on-error: true
needs: docker_tags
env:
COVERAGE_FILE: ".coverage.integration"
LS_USER: citric_ci
LS_PASSWORD: notverysecret
LS_PORT: "8080"
Expand Down Expand Up @@ -288,7 +290,7 @@ jobs:
if: always()
uses: actions/[email protected]
with:
name: coverage-data
name: coverage-integration
path: ".coverage.*"

- name: Generate badge filename
Expand Down Expand Up @@ -359,6 +361,10 @@ jobs:
needs: [tests, integration]
env:
NOXSESSION: coverage
strategy:
matrix:
flag: ["unit", "integration"]
fail-fast: false
steps:
- name: Check out the repository
uses: actions/[email protected]
Expand Down Expand Up @@ -393,9 +399,10 @@ jobs:
- name: Download coverage data
uses: actions/[email protected]
with:
name: coverage-data
name: coverage-${{ matrix.flag }}

- name: Combine coverage data and display human readable report
continue-on-error: true
run: |
nox
Expand All @@ -404,7 +411,9 @@ jobs:
nox -- xml
- name: Upload coverage report
uses: codecov/codecov-action@v3.1.4
uses: codecov/codecov-action@v4.0.0-beta.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
flags: ${{ matrix.flag }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ source = ["citric"]

[tool.coverage.report]
exclude_lines = ["pragma: no cover", '''if (t\.)?TYPE_CHECKING:''']
fail_under = 90
fail_under = 85
omit = ["src/citric/types.py"]
precision = 2
show_missing = true
Expand Down

0 comments on commit ba9f56a

Please sign in to comment.