diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3661be6..51d0156 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,10 +1,11 @@ name: Generate docs -on: [push] +on: + push: jobs: generate-docs: - name: Docs + name: docs runs-on: ubuntu-latest # only on default branch if: github.ref_name == github.event.repository.default_branch diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 681d21f..24ef5ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,12 @@ name: Run unit tests -on: [push, pull_request] +on: + push: + pull_request: jobs: test: - name: Python ${{ matrix.python-version }} + name: python ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: @@ -37,3 +39,20 @@ jobs: - name: Run tests run: | poetry run pytest -v + + - name: Measure coverage + if : ${{ github.event_name == 'push' && github.ref == github.event.repository.default_branch }} + run: | + poetry run pytest -v --cov --cov-report=xml + + - name: Upload to Codecov + if : ${{ github.event_name == 'push' && github.ref == github.event.repository.default_branch }} + uses: codecov/codecov-action@v4 + with: + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: false + files: ./coverage.xml + name: python-woc + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true