Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: refactor coverage check #312

Merged
merged 2 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
branch = True

[report]
fail_under = 100
show_missing = True
omit =
proto/marshal/compat.py
Expand Down
6 changes: 5 additions & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ branchProtectionRules:
- 'unit (3.7)'
- 'unit (3.7, cpp)'
- 'unit (3.8)'
# - 'unit (3.9, cpp)' # Don't have binary wheels for 3.9 cpp protobuf yet
- 'unit (3.9, cpp)'
- 'unit (3.9)'
- 'unit (3.10, cpp)'
- 'unit (3.10)'
- cover
- OwlBot Post Processor
- 'cla/google'
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
Expand Down
42 changes: 35 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,40 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install nox and codecov.
- name: Install nox
run: |
pip install nox
pip install codecov
- name: Run unit tests.
run: nox -s unit${{ matrix.variant }}-${{ matrix.python }}
- name: Submit coverage data to codecov.
run: codecov
if: always()
- name: Run unit tests
env:
COVERAGE_FILE: .coverage-${{ matrix.variant }}-${{ matrix.python }}
run: |
nox -s unit${{ matrix.variant }}-${{ matrix.python }}
- name: Upload coverage results
uses: actions/upload-artifact@v3
with:
name: coverage-artifacts
path: .coverage-${{ matrix.variant }}-${{ matrix.python }}
cover:
runs-on: ubuntu-latest
needs:
- unit
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install coverage
run: |
python -m pip install --upgrade setuptools pip wheel
python -m pip install coverage
- name: Download coverage results
uses: actions/download-artifact@v3
with:
name: coverage-artifacts
path: .coverage-results/
- name: Report coverage results
run: |
coverage combine .coverage-results/.coverage*
coverage report --show-missing --fail-under=100
4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Proto Plus for Python
=====================

|pypi| |release level| |docs| |codecov|
|pypi| |release level| |docs|

Beautiful, Pythonic protocol buffers.

Expand All @@ -26,5 +26,3 @@ Documentation
:target: https://cloud.google.com/terms/launch-stages
.. |docs| image:: https://readthedocs.org/projects/proto-plus-python/badge/?version=latest
:target: https://proto-plus-python.readthedocs.io/en/latest/
.. |codecov| image:: https://codecov.io/gh/googleapis/proto-plus-python/graph/badge.svg
:target: https://codecov.io/gh/googleapis/proto-plus-python