Skip to content

Commit

Permalink
ci(github): upload test results to Codecov
Browse files Browse the repository at this point in the history
- Add a separate step to upload test results to Codecov

Signed-off-by: Art Shendrik <artyom.shendrik@gmail.com>
  • Loading branch information
amal committed Nov 26, 2024
1 parent 146b6f2 commit 43d55df
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,38 @@ jobs:
comment: true
report_paths: '**/build/test-results/*/TEST-*.xml'

- name: Upload test results to Codecov
continue-on-error: true
if: (success() && !cancelled())
uses: codecov/test-results-action@v1
env:
OS: ${{ matrix.os }}
JAVA_VERSION: ${{ matrix.java }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: '**/build/test-results/*/TEST-*.xml'
env_vars: OS,JAVA_VERSION
flags: 'unit-tests,${{ matrix.os }}'
name: 'codecov-${{ matrix.os }}'
fail_ci_if_error: false
verbose: true

- name: Upload code coverage to Codecov
continue-on-error: true
if: (success() || failure()) && !contains(github.event.head_commit.message, 'coverage skip')
uses: codecov/codecov-action@v5
env:
OS: ${{ matrix.os }}
JAVA_VERSION: ${{ matrix.java }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/reports/kover-merged-report.xml
env_vars: OS,JAVA_VERSION
flags: 'unit-tests,${{ matrix.os }}'
name: 'codecov-${{ matrix.os }}'
fail_ci_if_error: false
#verbose: true

- name: Publish SNAPSHOT
id: snapshot
continue-on-error: true
Expand All @@ -179,22 +211,6 @@ jobs:
RELEASE: true
run: ./gradlew publish -DDISABLE_TESTS --no-configuration-cache --stacktrace --scan

- name: Upload code coverage
continue-on-error: true
if: (success() || failure()) && !contains(github.event.head_commit.message, 'coverage skip')
uses: codecov/codecov-action@v5
env:
OS: ${{ matrix.os }}
JAVA_VERSION: ${{ matrix.java }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/reports/kover-merged-report.xml
env_vars: OS,JAVA_VERSION
flags: 'unit-tests,${{ matrix.os }}'
name: 'codecov-${{ matrix.os }}'
fail_ci_if_error: false
verbose: true

- name: Upload the build report
if: always()
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 43d55df

Please sign in to comment.