Skip to content

Commit 679aa76

Browse files
committed
First pass at uploading test results to codecov
* Create an explicit directory for test reports rather than the workspace-tmp dir which might contain other files Signed-off-by: David Gardner <dagardner@nvidia.com>
1 parent a76755e commit 679aa76

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

.github/workflows/ci_pipe.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ on:
3939
description: 'The base SHA of the PR'
4040
required: true
4141
type: string
42+
secrets:
43+
CODECOV_TOKEN:
44+
required: true
4245

4346
# We only support ubuntu, so bash is the default
4447
defaults:
@@ -109,6 +112,10 @@ jobs:
109112
- python-version: "3.12"
110113
container: ${{ inputs.py_12_container }}
111114

115+
env:
116+
CI_PYTHON_VERSION: ${{ matrix.python-version }}
117+
CI_ARCH: ${{ matrix.arch }}
118+
112119
steps:
113120
- name: Checkout
114121
uses: actions/checkout@v4
@@ -127,9 +134,20 @@ jobs:
127134
if: ${{ always() }}
128135
with:
129136
name: "test-results-${{ matrix.arch }}-py${{ matrix.python-version }}"
130-
path: "${{ github.workspace }}/tmp/*.xml"
137+
path: "${{ github.workspace }}/tmp/reports/*.xml"
131138
if-no-files-found: error
132-
139+
- name: Upload coverage to Codecov
140+
uses: codecov/codecov-action@v5
141+
# Upload test results even if the tests fail
142+
if: ${{ always() }}
143+
with:
144+
directory: "${{ github.workspace }}/tmp/reports"
145+
env_vars: CI_ARCH,CI_PYTHON_VERSION
146+
fail_ci_if_error: true
147+
flags: unittests
148+
name: nat-code-cov-${{ matrix.arch }}-py${{ matrix.python-version }}
149+
token: ${{ secrets.CODECOV_TOKEN }}
150+
verbose: true
133151

134152
documentation:
135153
name: Documentation

ci/scripts/github/tests.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set -e
1919
GITHUB_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
2020

2121
source ${GITHUB_SCRIPT_DIR}/common.sh
22+
export REPORTS_DIR=${WORKSPACE_TMP}/reports
2223
get_lfs_files
2324

2425
create_env group:dev extra:all
@@ -27,9 +28,10 @@ rapids-logger "Git Version: $(git describe)"
2728
rapids-logger "Running tests with Python version $(python --version) and pytest version $(pytest --version) on $(arch)"
2829
set +e
2930

30-
pytest --junit-xml=${WORKSPACE_TMP}/report_pytest.xml \
31+
REPORT_IDENT_SLUG="$(arch)-py${PYTHON_VERSION}"
32+
pytest --junit-xml=${REPORTS_DIR}/report-${REPORT_IDENT_SLUG}_pytest.xml \
3133
--cov=nat --cov-report term-missing \
32-
--cov-report=xml:${WORKSPACE_TMP}/report_pytest_coverage.xml
34+
--cov-report=xml:${REPORTS_DIR}/report-${REPORT_IDENT_SLUG}_pytest_coverage.xml
3335
PYTEST_RESULTS=$?
3436

3537
exit ${PYTEST_RESULTS}

0 commit comments

Comments
 (0)