Skip to content

Add kover and gh action for coverage #25

Add kover and gh action for coverage

Add kover and gh action for coverage #25

Workflow file for this run

name: verify
on:
pull_request:
env:
JDK_VERSION: 21
GRADLE_OPTS: -Dorg.gradle.daemon=false
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Build and Run Tests
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '${{ env.JDK_VERSION }}'
cache: 'gradle'
- name: Build and Run Tests
run: ./gradlew test koverXmlReport
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Publish Kover Report
uses: madrapps/[email protected]
if: success() || failure() # always run even if the previous step fails
with:
paths: |
${{ github.workspace }}/build/reports/kover/report.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 50
min-coverage-changed-files: 60
- name: Coverage verify
run: ./gradlew koverVerify
detekt:
name: Detekt
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write
checks: write
# only required for workflows in private repositories
actions: read
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '${{ env.JDK_VERSION }}'
cache: 'gradle'
- name: Run Detekt
run: ./gradlew detekt
- name: Publish Detekt Report
uses: jwgmeligmeyling/checkstyle-github-action@master
if: success() || failure() # always run even if the previous step fails
with:
path: 'build/reports/detekt/merge.xml'