Skip to content

Commit

Permalink
Use the codecov as own step, not with default build
Browse files Browse the repository at this point in the history
  • Loading branch information
hamnis committed Aug 15, 2024
1 parent c2fc613 commit 9fbb8ce
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,34 @@ jobs:
uses: scalacenter/sbt-dependency-submission@v2
with:
configs-ignore: test scala-tool scala-doc-tool test-internal

coverage:
name: Generate coverage report
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13, 2.12, 3]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v4

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

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

- run: sbt '++ ${{ matrix.scala }}' coverage root/test coverageAggregate

- uses: codecov/codecov-action@v3
with:
flags: ${{matrix.scala}}
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ThisBuild / tlCiScalafixCheck := false // TODO: Address these in a follow up PR
ThisBuild / tlFatalWarnings := false // TODO: fix by dropping 2.12
ThisBuild / tlCiReleaseTags := true
ThisBuild / tlCiReleaseBranches := Nil
ThisBuild / circeRootOfCodeCoverage := Some("root")

val circeVersion = "0.14.9"
val munitVersion = "1.0.0"
Expand All @@ -26,8 +27,6 @@ def priorTo2_13(scalaVersion: String): Boolean =
val baseSettings = Seq(
resolvers ++= Resolver.sonatypeOssRepos("releases"),
resolvers ++= Resolver.sonatypeOssRepos("snapshots"),
coverageHighlighting := true,
coverageEnabled := !tlIsScala3.value,
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % circeVersion,
"org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0",
Expand Down

0 comments on commit 9fbb8ce

Please sign in to comment.