Skip to content

Commit

Permalink
Merge pull request #45 from codecov/pr45
Browse files Browse the repository at this point in the history
fix: use project-scoped artifact names, return test job result as workflow output
  • Loading branch information
matt-codecov authored Feb 22, 2025
2 parents 0b65427 + d618af6 commit 225cf78
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/run-tests-split.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ on:
working_directory:
type: string
default: .
outputs:
tests_passed:
# Silly issue with returning job results as workflow outputs
# https://github.com/actions/runner/issues/2495
value: ${{ fromJSON(toJSON(jobs.test)).result }}

env:
AR_REPO: ${{ inputs.repo }}
Expand Down Expand Up @@ -92,13 +97,13 @@ jobs:
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: coveragefiles-${{ matrix.group }}
name: ${{ inputs.flag_prefix }}-coveragefiles-${{ matrix.group }}
path: ${{ inputs.working_directory }}/*.coverage.xml

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: junitfiles-${{ matrix.group }}
name: ${{ inputs.flag_prefix }}-junitfiles-${{ matrix.group }}
path: ${{ inputs.working_directory }}/*junit*.xml

upload:
Expand Down Expand Up @@ -135,14 +140,14 @@ jobs:
id: download_coverage
uses: actions/download-artifact@v4
with:
pattern: coveragefiles-*
pattern: ${{ inputs.flag_prefix }}-coveragefiles-*
merge-multiple: true

- name: Download test results
id: download_test_results
uses: actions/download-artifact@v4
with:
pattern: junitfiles-*
pattern: ${{ inputs.flag_prefix }}-junitfiles-*
merge-multiple: true

- name: Uploading unit test coverage (${{ matrix.name }})
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
working_directory:
type: string
default: .
outputs:
tests_passed:
# Silly issue with returning job results as workflow outputs
# https://github.com/actions/runner/issues/2495
value: ${{ fromJSON(toJSON(jobs.test)).result }}

env:
AR_REPO: ${{ inputs.repo }}
Expand Down Expand Up @@ -67,13 +72,13 @@ jobs:
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: coveragefiles
name: ${{ inputs.flag_prefix }}-coveragefiles
path: ${{ inputs.working_directory }}/*.coverage.xml

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: junitfiles
name: ${{ inputs.flag_prefix }}-junitfiles
path: ${{ inputs.working_directory }}/*junit*.xml

upload:
Expand Down Expand Up @@ -110,13 +115,13 @@ jobs:
id: download_coverage
uses: actions/download-artifact@v4
with:
name: coveragefiles
name: ${{ inputs.flag_prefix }}-coveragefiles

- name: Download test results
id: download_test_results
uses: actions/download-artifact@v4
with:
name: junitfiles
name: ${{ inputs.flag_prefix }}-junitfiles

- name: Uploading unit test coverage (${{ matrix.name }})
uses: codecov/codecov-action@v5
Expand Down

0 comments on commit 225cf78

Please sign in to comment.