Skip to content

Commit

Permalink
👷 Add Kover metrics to CI
Browse files Browse the repository at this point in the history
Closes #198

Signed-off-by: Leonardo Colman Lopes <[email protected]>
  • Loading branch information
LeoColman committed Jan 24, 2025
1 parent 984959f commit 888a8bd
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/kover.main.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env kotlin
@file:Repository("https://repo1.maven.org/maven2/")
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.2.0")

@file:Repository("https://bindings.krzeminski.it")
@file:DependsOn("actions:checkout:v4")
@file:DependsOn("actions:setup-java:v4")
@file:DependsOn("gradle:gradle-build-action:v3")

import io.github.typesafegithub.workflows.actions.actions.Checkout
import io.github.typesafegithub.workflows.actions.actions.SetupJava
import io.github.typesafegithub.workflows.actions.gradle.GradleBuildAction
import io.github.typesafegithub.workflows.domain.RunnerType
import io.github.typesafegithub.workflows.domain.triggers.PullRequest
import io.github.typesafegithub.workflows.domain.triggers.Push
import io.github.typesafegithub.workflows.dsl.workflow


workflow(
name = "Dependency License Analysis",
on = listOf(Push(branches = listOf("main"))),
sourceFile = __FILE__
) {
job(id = "analyse", runsOn = RunnerType.UbuntuLatest) {
uses(name = "Set up JDK", action = SetupJava(javaVersion = "17", distribution = SetupJava.Distribution.Adopt))
uses(action = Checkout())
uses(action = GradleBuildAction(arguments = "koverHtmlReport"))
run(command = "cat app/build/reports/kover/html/index.html >> \$GITHUB_STEP_SUMMARY")
}
}
42 changes: 42 additions & 0 deletions .github/workflows/kover.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This file was generated using Kotlin DSL (.github/workflows/kover.main.kts).
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
# Generated with https://github.com/typesafegithub/github-workflows-kt

name: 'Dependency License Analysis'
on:
push:
branches:
- 'main'
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
runs-on: 'ubuntu-latest'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Execute script'
run: 'rm ''.github/workflows/kover.yaml'' && ''.github/workflows/kover.main.kts'''
- id: 'step-2'
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/kover.yaml'''
analyse:
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
name: 'Set up JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '17'
distribution: 'adopt'
- id: 'step-1'
uses: 'actions/checkout@v4'
- id: 'step-2'
uses: 'gradle/gradle-build-action@v3'
with:
arguments: 'koverHtmlReport'
- id: 'step-3'
run: 'cat app/build/reports/kover/html/index.html >> $GITHUB_STEP_SUMMARY'

0 comments on commit 888a8bd

Please sign in to comment.