Skip to content

Commit

Permalink
fix(build): removed test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mie6 committed Dec 27, 2024
1 parent 30c7928 commit fc47985
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 45 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,44 +367,6 @@ jobs:
modules-ignore: rootjs_2.13 rootjs_2.12 rootjs_3 docs_2.13 docs_2.12 docs_3 rootjvm_2.13 rootjvm_2.12 rootjvm_3 rootnative_2.13 rootnative_2.12 rootnative_3
configs-ignore: test scala-tool scala-doc-tool test-internal

coverage:
name: Run Test Coverage and Upload
if: github.ref == 'refs/heads/staging/5.0' || (github.event_name == 'pull_request' && github.base_ref == 'staging/5.0')
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v4

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt +update

- name: Generate coverage report
run: sbt '++ ${{ matrix.scala }}' coverage 'parsley / test' 'parsleyDebug / test' coverageReport

- name: Upload coverage to Code Climate
env:
CC_TEST_REPORTER_ID: c1f669dece75a1d69bf0dc45a682d64837badc112b8098271ccc0dca1bbc7a09
uses: paambaati/[email protected]
with:
coverageLocations: |
${{github.workspace}}/parsley/jvm/target/scala-2.13/coverage-report/cobertura.xml:cobertura
${{github.workspace}}/parsley-debug/jvm/target/scala-2.13/coverage-report/cobertura.xml:cobertura
site:
name: Generate Site
strategy:
Expand Down
17 changes: 10 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ inThisBuild(List(
tlCiScalafmtCheck := false,
tlCiHeaderCheck := true,
githubWorkflowJavaVersions := Seq(Java8, JavaLTS, JavaLatest),
githubWorkflowAddedJobs += testCoverageJob(githubWorkflowGeneratedCacheSteps.value.toList),
//githubWorkflowAddedJobs += testCoverageJob(githubWorkflowGeneratedCacheSteps.value.toList),
githubWorkflowConcurrency := None, // this allows us to not fail the pipeline on double commit
// Website Configuration
tlSitePublishBranch := Some(mainBranch),
Expand Down Expand Up @@ -128,23 +128,26 @@ lazy val docs = project
),
)

def testCoverageJob(cacheSteps: List[WorkflowStep]) = WorkflowJob(
/*def testCoverageJob(cacheSteps: List[WorkflowStep]) = WorkflowJob(
id = "coverage",
name = "Run Test Coverage and Upload",
cond = Some(s"github.ref == 'refs/heads/$mainBranch' || (github.event_name == 'pull_request' && github.base_ref == '$mainBranch')"),
steps =
WorkflowStep.Checkout ::
WorkflowStep.SetupSbt ::
WorkflowStep.SetupJava(List(JavaLTS)) :::
cacheSteps ::: List(
WorkflowStep.Sbt(name = Some("Generate coverage report"), commands = List("coverage", "parsley / test", "parsleyDebug / test", "coverageReport")),
WorkflowStep.Use(
name = Some("Upload coverage to Code Climate"),
ref = UseRef.Public(owner = "paambaati", repo = "codeclimate-action", ref = "v3.2.0"),
env = Map("CC_TEST_REPORTER_ID" -> "c1f669dece75a1d69bf0dc45a682d64837badc112b8098271ccc0dca1bbc7a09"),
// FIXME: Surely, there's a better method for multiple report locations than a multiline string (or using \n as a separator).
params = Map("coverageLocations" ->
"""${{github.workspace}}/parsley/jvm/target/scala-2.13/coverage-report/cobertura.xml:cobertura
|${{github.workspace}}/parsley-debug/jvm/target/scala-2.13/coverage-report/cobertura.xml:cobertura""".stripMargin),
params = Map("coverageLocations" -> Seq(
coverageReport("parsley"),
coverageReport("parsley-debug"),
).mkString("\n")),
)
)
)
)*/

def coverageReport(project: String) = s"$${{github.workspace}}/$project/jvm/target/scala-2.13/coverage-report/cobertura.xml:cobertura"

0 comments on commit fc47985

Please sign in to comment.