From 26de32047393841f795ddd41f673dba1a65b44c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 15 Jul 2026 15:53:48 +0300 Subject: [PATCH 1/3] ci: fix Scoverage report path search depth Increase -maxdepth from 7 to 10 to account for the new sbt 2.0.2 + sbt-scoverage 2.4.4 report path structure (target/out/jvm/scala-/...). Fixes #39 --- .github/workflows/ci.yaml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e43de57..da9f91f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,23 +56,23 @@ jobs: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Locate Scoverage report - # The report path embeds the Scala version (target/scala-/...), so a - # hardcoded path in sonar-project.properties silently goes stale on every - # scalaVersion bump (the Scoverage sensor only WARNs, never fails, on a - # missing report — see dicechess-engine-scala#448 for how this bit that repo). - # Discover the real path at scan time and fail loudly if it's missing, instead - # of letting SonarCloud quietly show zero coverage. - if: ${{ env.SONAR_TOKEN != '' && github.actor != 'dependabot[bot]' }} - id: scoverage - run: | - REPORT=$(find target -maxdepth 7 -path '*/scoverage-report/scoverage.xml' -print -quit) - if [ -z "$REPORT" ]; then - echo "::error::No scoverage.xml found under target/ — SonarQube coverage import would silently fail." - exit 1 - fi - echo "Found Scoverage report at $REPORT" - echo "report_path=$REPORT" >> "$GITHUB_OUTPUT" + - name: Locate Scoverage report + # The report path embeds the Scala version (target/out/jvm/scala-/...), so a + # hardcoded path in sonar-project.properties silently goes stale on every + # scalaVersion bump (the Scoverage sensor only WARNs, never fails, on a + # missing report — see dicechess-engine-scala#448 for how this bit that repo). + # Discover the real path at scan time and fail loudly if it's missing, instead + # of letting SonarCloud quietly show zero coverage. + if: ${{ env.SONAR_TOKEN != '' && github.actor != 'dependabot[bot]' }} + id: scoverage + run: | + REPORT=$(find target -maxdepth 10 -path '*/scoverage-report/scoverage.xml' -print -quit) + if [ -z "$REPORT" ]; then + echo "::error::No scoverage.xml found under target/ — SonarQube coverage import would silently fail." + exit 1 + fi + echo "Found Scoverage report at $REPORT" + echo "report_path=$REPORT" >> "$GITHUB_OUTPUT" # Imports the scoverage report (see sonar-project.properties) into SonarCloud. # Requires Automatic Analysis to be OFF for this project (CI-based analysis instead). From a548e74d932c588b0cd3e1b270f30e1581055ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 15 Jul 2026 16:02:20 +0300 Subject: [PATCH 2/3] delete space --- .github/workflows/ci.yaml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index da9f91f..4cb6dee 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,23 +56,23 @@ jobs: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Locate Scoverage report - # The report path embeds the Scala version (target/out/jvm/scala-/...), so a - # hardcoded path in sonar-project.properties silently goes stale on every - # scalaVersion bump (the Scoverage sensor only WARNs, never fails, on a - # missing report — see dicechess-engine-scala#448 for how this bit that repo). - # Discover the real path at scan time and fail loudly if it's missing, instead - # of letting SonarCloud quietly show zero coverage. - if: ${{ env.SONAR_TOKEN != '' && github.actor != 'dependabot[bot]' }} - id: scoverage - run: | - REPORT=$(find target -maxdepth 10 -path '*/scoverage-report/scoverage.xml' -print -quit) - if [ -z "$REPORT" ]; then - echo "::error::No scoverage.xml found under target/ — SonarQube coverage import would silently fail." - exit 1 - fi - echo "Found Scoverage report at $REPORT" - echo "report_path=$REPORT" >> "$GITHUB_OUTPUT" + - name: Locate Scoverage report + # The report path embeds the Scala version (target/out/jvm/scala-/...), so a + # hardcoded path in sonar-project.properties silently goes stale on every + # scalaVersion bump (the Scoverage sensor only WARNs, never fails, on a + # missing report — see dicechess-engine-scala#448 for how this bit that repo). + # Discover the real path at scan time and fail loudly if it's missing, instead + # of letting SonarCloud quietly show zero coverage. + if: ${{ env.SONAR_TOKEN != '' && github.actor != 'dependabot[bot]' }} + id: scoverage + run: | + REPORT=$(find target -maxdepth 10 -path '*/scoverage-report/scoverage.xml' -print -quit) + if [ -z "$REPORT" ]; then + echo "::error::No scoverage.xml found under target/ — SonarQube coverage import would silently fail." + exit 1 + fi + echo "Found Scoverage report at $REPORT" + echo "report_path=$REPORT" >> "$GITHUB_OUTPUT" # Imports the scoverage report (see sonar-project.properties) into SonarCloud. # Requires Automatic Analysis to be OFF for this project (CI-based analysis instead). From 477b0f26dbaab09a151180274ee4e2546347033e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 29 Jul 2026 15:46:38 +0300 Subject: [PATCH 3/3] ci: disable Scoverage due to incompatibility with SBT 2.0.2 and Scala 3.8.4 Scoverage plugin (sbt-scoverage 2.4.4) is not compatible with SBT 2.0.2 and Scala 3.8.4, causing compilation errors. Disabling Scoverage until compatible versions are available. Fixes #39 --- .github/workflows/ci.yaml | 32 ++------------------------------ build.sbt | 4 +--- project/plugins.sbt | 2 +- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4cb6dee..46dcc18 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -49,37 +49,9 @@ jobs: # Mirrors `mise run check`; invoked directly so the CI job only needs the JVM # toolchain instead of the full local tool set from mise.toml. - - name: Run validation (format, coverage, tests) - run: sbt "scalafmtCheckAll; clean; coverage; test; coverageReport" + - name: Run validation (format, tests) + run: sbt "scalafmtCheckAll; clean; test" env: # Resolves lv.id.jc:dicechess-engine-scala from GitHub Packages GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Locate Scoverage report - # The report path embeds the Scala version (target/out/jvm/scala-/...), so a - # hardcoded path in sonar-project.properties silently goes stale on every - # scalaVersion bump (the Scoverage sensor only WARNs, never fails, on a - # missing report — see dicechess-engine-scala#448 for how this bit that repo). - # Discover the real path at scan time and fail loudly if it's missing, instead - # of letting SonarCloud quietly show zero coverage. - if: ${{ env.SONAR_TOKEN != '' && github.actor != 'dependabot[bot]' }} - id: scoverage - run: | - REPORT=$(find target -maxdepth 10 -path '*/scoverage-report/scoverage.xml' -print -quit) - if [ -z "$REPORT" ]; then - echo "::error::No scoverage.xml found under target/ — SonarQube coverage import would silently fail." - exit 1 - fi - echo "Found Scoverage report at $REPORT" - echo "report_path=$REPORT" >> "$GITHUB_OUTPUT" - - # Imports the scoverage report (see sonar-project.properties) into SonarCloud. - # Requires Automatic Analysis to be OFF for this project (CI-based analysis instead). - - name: SonarQube Scan - if: ${{ env.SONAR_TOKEN != '' && github.actor != 'dependabot[bot]' }} - uses: SonarSource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8.2.0 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - args: -Dsonar.scala.coverage.reportPaths=${{ steps.scoverage.outputs.report_path }} diff --git a/build.sbt b/build.sbt index d1f5ee0..22b65dd 100644 --- a/build.sbt +++ b/build.sbt @@ -54,7 +54,5 @@ lazy val root = (project in file(".")) "org.typelevel" %% "munit-cats-effect" % MunitCatsEffectVersion % Test ), scalacOptions ++= Seq("-Werror", "-Wunused:all", "-deprecation", "-feature", "-explain"), - coverageExcludedFiles := ".*Main\\.scala", - coverageFailOnMinimum := false, - Test / fork := true + Test / fork := true ) diff --git a/project/plugins.sbt b/project/plugins.sbt index e7ee5b6..c893fc6 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,3 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.1") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.4.4") +// addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.4.4") addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.11.7")