From 2a9ee3260d62ec2852945c21dc8db145c826b041 Mon Sep 17 00:00:00 2001 From: Hanna Kurhuzenkava Date: Fri, 22 Mar 2024 14:39:23 +0300 Subject: [PATCH 1/5] MAIN-T-92 Add Qodana to pipeline --- .github/workflows/gradle.yml | 11 +++++++++++ qodana.yaml | 15 +++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 qodana.yaml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 2b15fa48..41b2aad0 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -10,6 +10,17 @@ defaults: jobs: + qodana: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2023.3 + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + unit: runs-on: ubuntu-latest permissions: diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 00000000..8e320011 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,15 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# +version: "1.0" + +profile: + name: qodana.recommended + +include: + - name: CheckDependencyLicenses + +projectJDK: "17" + +linter: jetbrains/qodana-jvm:latest From 439e1e9b887e4cd7b62099fa9cb192578acad1d6 Mon Sep 17 00:00:00 2001 From: Hanna Kurhuzenkava Date: Fri, 22 Mar 2024 15:18:59 +0300 Subject: [PATCH 2/5] MAIN-T-92 Add Qodana to pipeline --- .github/workflows/gradle.yml | 7 +++-- .space.kts | 56 ++++++++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 41b2aad0..dffc0ed1 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -13,9 +13,12 @@ jobs: qodana: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - fetch-depth: 0 + java-version: '17' + distribution: 'temurin' - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2023.3 env: diff --git a/.space.kts b/.space.kts index 5e67060b..b36922aa 100644 --- a/.space.kts +++ b/.space.kts @@ -13,6 +13,35 @@ import java.time.temporal.TemporalAdjusters val gradleImageVersion = "gradle:8.2-jdk17" +job("Check Qodana Settings") { + val sharedCoveragePath = "coverage" + container(displayName = "Unit tests", image = gradleImageVersion) { + workDir = "server" + shellScript { + content = """ + ./gradlew koverVerify + mkdir ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath + cd build/kover/bin-reports + cp -a . ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath + cd ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath + ls -la + """.trimIndent() + } + } + + container("jetbrains/qodana-jvm:latest") { + env["QODANA_TOKEN"] = "{{ project:qodana-token }}" + shellScript { + content = """ + qodana \ + --project-dir server \ + --profile-name qodana.recommended \ + -v ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath:/data/coverage + """.trimIndent() + } + } +} + job("Tests for main branch") { startOn { gitPush { @@ -22,10 +51,33 @@ job("Tests for main branch") { } } + val sharedCoveragePath = "coverage" container(displayName = "Unit tests", image = gradleImageVersion) { workDir = "server" - kotlinScript { api -> - api.gradlew("koverVerify") + shellScript { + content = """ + ./gradlew koverVerify + mkdir ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath + cd build/kover/bin-reports + cp -a . ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath + cd ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath + ls -la + """.trimIndent() + } +// kotlinScript { api -> +// api.gradlew("koverVerify") +// } + } + + container("jetbrains/qodana-jvm:latest") { + env["QODANA_TOKEN"] = "{{ project:qodana-token }}" + shellScript { + content = """ + qodana \ + --project-dir server \ + --profile-name qodana.recommended \ + -v ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath:/data/coverage + """.trimIndent() } } From 82574791322e2c850c417d6e54c40909c940c8e2 Mon Sep 17 00:00:00 2001 From: Hanna Kurhuzenkava Date: Fri, 22 Mar 2024 15:38:20 +0300 Subject: [PATCH 3/5] MAIN-T-92 Add Qodana to pipeline --- .space.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.space.kts b/.space.kts index b36922aa..6d36dcca 100644 --- a/.space.kts +++ b/.space.kts @@ -36,7 +36,7 @@ job("Check Qodana Settings") { qodana \ --project-dir server \ --profile-name qodana.recommended \ - -v ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath:/data/coverage + --coverage-dir ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath """.trimIndent() } } From 267254d1421fb74256e3d3f368eb498b6f0e671e Mon Sep 17 00:00:00 2001 From: Hanna Kurhuzenkava Date: Fri, 22 Mar 2024 16:16:27 +0300 Subject: [PATCH 4/5] MAIN-T-92 Add Qodana to pipeline --- .github/workflows/gradle.yml | 26 +++++++++++++------------- qodana.yaml | 15 --------------- 2 files changed, 13 insertions(+), 28 deletions(-) delete mode 100644 qodana.yaml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index dffc0ed1..69ec2bd3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -10,19 +10,19 @@ defaults: jobs: - qodana: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.3 - env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} +# qodana: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Set up JDK 17 +# uses: actions/setup-java@v4 +# with: +# java-version: '17' +# distribution: 'temurin' +# - name: 'Qodana Scan' +# uses: JetBrains/qodana-action@v2023.3 +# env: +# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} unit: runs-on: ubuntu-latest diff --git a/qodana.yaml b/qodana.yaml deleted file mode 100644 index 8e320011..00000000 --- a/qodana.yaml +++ /dev/null @@ -1,15 +0,0 @@ -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: "1.0" - -profile: - name: qodana.recommended - -include: - - name: CheckDependencyLicenses - -projectJDK: "17" - -linter: jetbrains/qodana-jvm:latest From 43784e50c542dbf573f3b8a43ce45dfe9f7a9e8c Mon Sep 17 00:00:00 2001 From: Hanna Kurhuzenkava Date: Fri, 22 Mar 2024 16:44:11 +0300 Subject: [PATCH 5/5] MAIN-T-92 Add Qodana to pipeline --- .github/workflows/gradle.yml | 14 ------------- .space.kts | 38 +++--------------------------------- 2 files changed, 3 insertions(+), 49 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 69ec2bd3..2b15fa48 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -10,20 +10,6 @@ defaults: jobs: -# qodana: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - name: Set up JDK 17 -# uses: actions/setup-java@v4 -# with: -# java-version: '17' -# distribution: 'temurin' -# - name: 'Qodana Scan' -# uses: JetBrains/qodana-action@v2023.3 -# env: -# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} - unit: runs-on: ubuntu-latest permissions: diff --git a/.space.kts b/.space.kts index 6d36dcca..250d9ca7 100644 --- a/.space.kts +++ b/.space.kts @@ -13,35 +13,6 @@ import java.time.temporal.TemporalAdjusters val gradleImageVersion = "gradle:8.2-jdk17" -job("Check Qodana Settings") { - val sharedCoveragePath = "coverage" - container(displayName = "Unit tests", image = gradleImageVersion) { - workDir = "server" - shellScript { - content = """ - ./gradlew koverVerify - mkdir ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath - cd build/kover/bin-reports - cp -a . ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath - cd ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath - ls -la - """.trimIndent() - } - } - - container("jetbrains/qodana-jvm:latest") { - env["QODANA_TOKEN"] = "{{ project:qodana-token }}" - shellScript { - content = """ - qodana \ - --project-dir server \ - --profile-name qodana.recommended \ - --coverage-dir ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath - """.trimIndent() - } - } -} - job("Tests for main branch") { startOn { gitPush { @@ -52,7 +23,7 @@ job("Tests for main branch") { } val sharedCoveragePath = "coverage" - container(displayName = "Unit tests", image = gradleImageVersion) { + container(displayName = "Unit tests with coverage", image = gradleImageVersion) { workDir = "server" shellScript { content = """ @@ -64,19 +35,16 @@ job("Tests for main branch") { ls -la """.trimIndent() } -// kotlinScript { api -> -// api.gradlew("koverVerify") -// } } - container("jetbrains/qodana-jvm:latest") { + container(displayName = "Qodana scan", image = "jetbrains/qodana-jvm:latest") { env["QODANA_TOKEN"] = "{{ project:qodana-token }}" shellScript { content = """ qodana \ --project-dir server \ --profile-name qodana.recommended \ - -v ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath:/data/coverage + --coverage-dir ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedCoveragePath """.trimIndent() } }