Skip to content

Commit ed8eb3c

Browse files
authored
Ktlint, Detekt and Kover CI (#56)
1 parent bf0b8af commit ed8eb3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+439
-110
lines changed

.editorconfig

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ ij_kotlin_keep_blank_lines_in_code = 1
99
ij_kotlin_keep_blank_lines_before_right_brace = 0
1010
ij_kotlin_align_multiline_parameters = false
1111
ij_continuation_indent_size = 4
12-
13-
[**/commonTest/**.kt]
14-
ktlint_ignore_back_ticked_identifier=true
12+
ij_kotlin_allow_trailing_comma_on_call_site = true
13+
ij_kotlin_allow_trailing_comma = true

.github/workflows/build.yml

+39-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,48 @@
11
name: Build
22
on:
33
push:
4-
branches: [main]
4+
branches: [ main ]
5+
pull_request:
56
workflow_dispatch:
67
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
- name: Setup JDK 8
14+
uses: actions/setup-java@v2
15+
with:
16+
java-version: '8'
17+
distribution: 'adopt'
18+
server-id: github
19+
cache: 'gradle'
20+
- name: Gradle Wrapper Validation
21+
uses: gradle/[email protected]
22+
- name: KtLint
23+
uses: burrunan/gradle-cache-action@v1
24+
with:
25+
arguments: lintKotlin --continue --stacktrace
26+
gradle-version: wrapper
27+
- name: Detekt
28+
uses: burrunan/gradle-cache-action@v1
29+
with:
30+
arguments: detekt --continue --stacktrace
31+
gradle-version: wrapper
32+
- name: Kover
33+
uses: burrunan/gradle-cache-action@v1
34+
with:
35+
arguments: koverXmlReport --continue --stacktrace
36+
gradle-version: wrapper
37+
continue-on-error: true
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v3
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
files: ${{ github.workspace }}/build/reports/kover/report.xml
43+
fail_ci_if_error: true
44+
verbose: true
745
build:
8-
name: Build
946
runs-on: ubuntu-latest
1047
permissions:
1148
contents: read

.github/workflows/super-linter.yml

-28
This file was deleted.

build.gradle.kts

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// https://youtrack.jetbrains.com/issue/KTIJ-19369
22
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
33

4+
import io.gitlab.arturbosch.detekt.Detekt
5+
46
plugins {
57
alias(libs.plugins.kotlin.multiplatform)
68
alias(libs.plugins.kotlinx.serialization)
@@ -161,9 +163,23 @@ tasks {
161163
check {
162164
dependsOn("installKotlinterPrePushHook")
163165
}
166+
167+
withType<Detekt>().configureEach {
168+
jvmTarget = "1.8"
169+
170+
reports {
171+
xml.required.set(true)
172+
}
173+
}
164174
}
165175

166176
detekt {
167177
buildUponDefaultConfig = true
168178
allRules = false
179+
config = files("$projectDir/config/detekt.yml")
180+
baseline = file("$projectDir/config/baseline.xml")
181+
}
182+
183+
kover {
184+
isDisabled.set(false)
169185
}

config/baseline.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" ?>
2+
<SmellBaseline>
3+
<ManuallySuppressedIssues/>
4+
<CurrentIssues>
5+
</CurrentIssues>
6+
</SmellBaseline>

0 commit comments

Comments
 (0)