Skip to content

Commit

Permalink
Updating diktat version and corresponding action, adding the integrat…
Browse files Browse the repository at this point in the history
…ion with github (#109)

### What's done:
- diktat action update
  • Loading branch information
orchestr7 authored Feb 19, 2022
1 parent 0ef414b commit 61d0cea
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/diktat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,31 @@ jobs:
GRADLE_OPTS: -Dorg.gradle.daemon=false

steps:
- uses: actions/checkout@v2.3.3
- uses: actions/checkout@v2.4.0
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 1.11
- name: Gradle build with remote cache
uses: burrunan/gradle-cache-action@v1
java-version: 11
distribution: zulu
- uses: burrunan/gradle-cache-action@v1
with:
arguments: diktatCheckAll
properties: |
org.gradle.caching=true
gradle-version: wrapper
# additional files to calculate key for dependency cache
gradle-dependencies-cache-key: |
buildSrc/**/Versions.kt
arguments: |
diktatCheckAll
properties: |
diktat.githubActions=true
- name: Copy SARIF reports into a single directory
if: ${{ always() }}
# `find` cmd is a workaround for https://github.com/analysis-dev/diktat/issues/1213
run: |
mkdir -p build/diktat-sarif-reports
i=0
find . -regex '.*\(/[^/]*\)\1' | while read -r f; do echo "$f -> diktat-$i.sarif" && cp $f build/diktat-sarif-reports/diktat-$i.sarif || echo Cannot copy && echo Copied && i=$((i+1)); done
- name: Upload SARIF report to Github
uses: github/codeql-action/upload-sarif@v1
if: ${{ always() }}
with:
sarif_file: build/diktat-sarif-reports
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
// this hack prevents the following bug: https://github.com/gradle/gradle/issues/9770
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")

implementation("org.cqfn.diktat:diktat-gradle-plugin:1.0.2")
implementation("org.cqfn.diktat:diktat-gradle-plugin:1.0.3")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.15.0")
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
implementation("org.ajoberstar.reckon:reckon-gradle:0.13.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fun Project.configureDiktat() {
apply<DiktatGradlePlugin>()
configure<DiktatExtension> {
diktatConfigFile = rootProject.file("diktat-analysis.yml")
githubActions = findProperty("diktat.githubActions")?.toString()?.toBoolean() ?: false
inputs {
include("src/**/*.kt", "*.kts", "src/**/*.kts")
exclude("$projectDir/build/**", "src/commonTest/**/*.kt")
Expand All @@ -33,6 +34,7 @@ fun Project.createDiktatTask() {
apply<DiktatGradlePlugin>()
configure<DiktatExtension> {
diktatConfigFile = rootProject.file("diktat-analysis.yml")
githubActions = findProperty("diktat.githubActions")?.toString()?.toBoolean() ?: false
inputs {
include(
"$rootDir/buildSrc/src/**/*.kt",
Expand Down

0 comments on commit 61d0cea

Please sign in to comment.