Skip to content

SonarCloud Scan -- main #94

SonarCloud Scan -- main

SonarCloud Scan -- main #94

name: Code Coverage (Sonar Cloud)
run-name: SonarCloud Scan -- ${{github.event.workflow_run.head_branch}}
on:
workflow_run:
workflows:
- Build Workflow
types:
- completed
jobs:
code-coverage:
name: Code Coverage
runs-on: ubuntu-24.04
steps:
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
# settings.xml credentials for Nexus
# - name: maven settings
# uses: s4u/maven-settings-action@v3.1.0
# with:
# servers: '[{"id": "nexus-repo", "username": "${{ secrets.NEXUS_USER_DEMO }}", "password": "${{secrets.NEXUS_PASSWORD_DEMO}}" }]'
- name: IKMDEV Code Coverage
uses: ikmdev/maven-code-coverage-action@main
with:
repo_name: ${{github.event.workflow_run.head_repository.full_name}}
branch_name: ${{github.event.workflow_run.head_branch}}
sonarcloud_token: ${{ secrets.SONAR_TOKEN }}
sonarcloud_host_url: ${{ 'https://sonarcloud.io/' }}
sonarcloud_organization: ${{ github.repository_owner }}
sonarcloud_sources: ${{ 'src/main/java' }}
sonarcloud_projectKey: ${{ github.repository_owner }}_${{ github.event.repository.name }}
sonarcloud_coverage_jacoco_xmlReportPaths: ${{ 'target/site/jacoco/jacoco.xml' }}
sonarcloud_java_binaries: ${{ 'target/classes' }}
sonarcloud_tests: ${{ 'src/test/java' }}