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

[CLIENT-2203] CI/CD: Refactor code coverage report code #647

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
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
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR tests

env:
LOWEST_SUPPORTED_PY_VERSION: '3.8'

COVERAGE_REPORT_ARTIFACT_NAME: coverage-report
# Trigger test workflow whenever:
# 1. A pull request is updated (e.g with new commits)
# 2. Commits are pushed directly to the dev, stage or master branch
Expand Down Expand Up @@ -88,6 +88,8 @@ jobs:
python-version: "3.9"
architecture: 'x64'

- run: python3 -m pip install -r requirements.txt

- name: Build client
# Use old build command to generate object .o files in build/temp*/src/main directory
# They will also contain .gcno files there
Expand Down Expand Up @@ -153,11 +155,13 @@ jobs:
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: coverage-report
name: ${{ env.COVERAGE_REPORT_ARTIFACT_NAME }}
path: build/temp*/src/main/

coverage-upload:
needs: generate-coverage-report
env:
COVERAGE_REPORT_FOLDER: coverage-report
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
Expand All @@ -167,12 +171,12 @@ jobs:

- uses: actions/download-artifact@v3
with:
name: coverage-report
path: ./coverage-report
name: ${{ env.COVERAGE_REPORT_ARTIFACT_NAME }}
path: ./${{ env.COVERAGE_REPORT_FOLDER }}

- uses: codecov/codecov-action@v3
with:
directory: coverage-report
directory: ${{ env.COVERAGE_REPORT_FOLDER }}
verbose: true # optional (default = false)
fail_ci_if_error: true
env:
Expand Down
Loading