Skip to content

Commit

Permalink
workflows/tests: add coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
airwoodix committed Feb 23, 2024
1 parent 5df262f commit bc379eb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: "pip"
- name: Install uv
run: |
# https://github.com/astral-sh/uv/issues/1386#issuecomment-1947801083
Expand Down Expand Up @@ -110,26 +111,26 @@ jobs:
run: poe lint
- name: Type checking
run: poe typecheck
- name: Testing
run: poe test
# - name: Docs
# run: poetry run poe docs
# if: startsWith(matrix.os, 'ubuntu')
# - name: Generate coverage report
# run: poetry run coverage lcov -o coverage.lcov
# if: startsWith(matrix.os, 'ubuntu')
# - name: Upload coverage report
# uses: coverallsapp/github-action@v2
# with:
# file: coverage.lcov
# parallel: true
# flag-name: run ${{ join(matrix.*, ' - ') }}
# if: startsWith(matrix.os, 'ubuntu')
# finish:
# needs: tests
# runs-on: ubuntu-latest
# steps:
# - name: Close parallel coverage build
# uses: coverallsapp/github-action@v2
# with:
# parallel-finished: true
- name: Run examples with coverage
run: |
./examples/run_all.sh -c
- name: Run tests with coverage
run: poe test --cov_opts="-a" # add to examples coverage
- name: Build docs
run: poe docs
- name: Generate coverage report
run: coverage lcov -o coverage.lcov
- name: Upload coverage report
uses: coverallsapp/github-action@v2
with:
file: coverage.lcov
parallel: true
flag-name: run ${{ join(matrix.*, ' - ') }}
finish:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Close parallel coverage build
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ convention = "google"
[tool.coverage.run]
dynamic_context = "test_function"
relative_files = true
omit = [
"examples/*.py",
]

[tool.coverage.report]
fail_under = 99
Expand Down

0 comments on commit bc379eb

Please sign in to comment.