From 0e96f19491651014feca33ff3cd7bfc89016b78f Mon Sep 17 00:00:00 2001 From: Ole Kliemann Date: Thu, 17 Oct 2024 20:10:03 +0000 Subject: [PATCH] Upload to codecov --- .github/workflows/pytest-coverage.yml | 24 ++++++++---------------- README.md | 1 + 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pytest-coverage.yml b/.github/workflows/pytest-coverage.yml index 47e041d..885a14d 100644 --- a/.github/workflows/pytest-coverage.yml +++ b/.github/workflows/pytest-coverage.yml @@ -2,9 +2,9 @@ name: pytest on: push: - branches: [ main ] # Run on pushes to the main branch + branches: [ main ] pull_request: - branches: [ main ] # Run on pull requests to the main branch + branches: [ main ] jobs: test: @@ -17,12 +17,12 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.12' # Specify your Python version here + python-version: '3.12' - name: Install Poetry uses: snok/install-poetry@v1 with: - poetry-version: 1.8.3 # Specify the Poetry version you need + poetry-version: 1.8.3 - name: Install dependencies run: | @@ -30,17 +30,9 @@ jobs: - name: Run tests with coverage run: | - poetry run pytest --cov=drresult # Adjust the path if necessary + poetry run pytest --cov --cov-report=xml - - name: Generate coverage report - run: | - poetry run coverage xml - poetry run coverage html - - - name: Upload coverage report - uses: actions/upload-artifact@v3 + - name: Upload results to Codecov + uses: codecov/codecov-action@v4 with: - name: coverage-report - path: | - htmlcov - coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index c94e485..cfe5df2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ![tests](https://github.com/olekli/drresult/actions/workflows/pytest-coverage.yml/badge.svg) +[![codecov](https://codecov.io/github/olekli/DrResult/branch/main/graph/badge.svg?token=WLSOABF6I6)](https://codecov.io/github/olekli/DrResult) # DrResult