Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/workflows/Check.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/check-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check

on:
push:
branches-ignore:
- main
paths-ignore:
- '**.md'

concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3

- name: Initialization
uses: ./.github/actions/init
with:
jdk: 17

- name: Build
uses: gradle/gradle-build-action@v2.7.0
with:
arguments: build -x test

- name: Test
uses: gradle/gradle-build-action@v2.4.0
with:
arguments: test
38 changes: 38 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: SonarCloud

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: sonar-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3

- name: Initialization
uses: ./.github/actions/init
with:
jdk: 17

- name: Build
uses: gradle/gradle-build-action@v2.7.0
env:
DETEKT_IGNORE_FAILURES: true
with:
arguments: build detekt test jacocoTestReport

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
24 changes: 24 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,24 @@ plugins {
embeddedKotlin("plugin.serialization")
id("org.jetbrains.dokka") version "1.8.20"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.gitlab.arturbosch.detekt") version "1.23.1"
`maven-publish`
`java-library`
jacoco
}

detekt {
// Allows having different behavior for CI.
// When building a branch, we want to fail the build if detekt fails.
// When building a PR, we want to ignore failures to report them in sonar.
val envIgnoreFailures = System.getenv("DETEKT_IGNORE_FAILURES")?.toBooleanStrictOrNull() ?: false
ignoreFailures = envIgnoreFailures

config.from(file("config/detekt/detekt.yml"))
}

jacoco {
reportsDirectory.set(file("${layout.buildDirectory.get()}/reports/jacoco"))
}

repositories {
Expand Down Expand Up @@ -129,6 +145,14 @@ tasks {
shadowJar {
archiveClassifier.set("")
}

jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(true)
csv.required.set(false)
}
}
}

val deleteDokkaOutputDir by tasks.register<Delete>("deleteDokkaOutputDirectory") {
Expand Down
Loading