Skip to content

Add JaCoCo codecov configuration #499

Add JaCoCo codecov configuration

Add JaCoCo codecov configuration #499

Workflow file for this run

name: Build
on:
push:
workflow_dispatch: # allow manual trigger
jobs:
build:
strategy:
fail-fast: false
# screenshot tests cannot be run across operating systems; see https://github.com/JetBrains/compose-multiplatform/issues/3442
matrix:
os: [ windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '18'
- run: ./gradlew --stacktrace --continue check
- name: Upload mismatching screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: mismatching-screenshots
path: '**/src/test/resources/screenshots/**/*-MISMATCH.png'
if-no-files-found: ignore
retention-days: 7
- name: Upload unit test results to codecov
uses: codecov/codecov-action@v4
if: always() # upload even if the build failed, in case it was just test failures
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./code-coverage-report/build/reports/jacoco/jacocoMergedUnitTestReport/jacocoMergedUnitTestReport.xml
fail_ci_if_error: true
verbose: true
flags: unit
- name: Upload screenshot test results to codecov
uses: codecov/codecov-action@v4
if: always() # upload even if the build failed, in case it was just test failures
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./code-coverage-report/build/reports/jacoco/jacocoMergedScreenshotTestReport/jacocoMergedScreenshotTestReport.xml
fail_ci_if_error: true
verbose: true
flags: screenshot