From 079fc6a63fc3b0db5568f71b9a7bb6904a4232af Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 2 May 2022 05:30:06 -0400 Subject: [PATCH] ci: refactor coverage check (#312) * ci: refactor coverage check * update required checks --- .coveragerc | 1 - .github/sync-repo-settings.yaml | 6 ++++- .github/workflows/tests.yml | 42 +++++++++++++++++++++++++++------ README.rst | 4 +--- 4 files changed, 41 insertions(+), 12 deletions(-) diff --git a/.coveragerc b/.coveragerc index 55fda8f0..12a43d1c 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,7 +2,6 @@ branch = True [report] -fail_under = 100 show_missing = True omit = proto/marshal/compat.py diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 7e74b00b..dc6350a8 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 026e15c2..da36ebaf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/README.rst b/README.rst index 08ec2bd9..871fdebb 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ Proto Plus for Python ===================== -|pypi| |release level| |docs| |codecov| +|pypi| |release level| |docs| Beautiful, Pythonic protocol buffers. @@ -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