Skip to content

Commit

Permalink
Update circleci config to publish coverage report to codecov (#96)
Browse files Browse the repository at this point in the history
- Upgrade `sbt-scoverage` to support Scala 2.13.8
- Update `.circleci/config.yml`
  - Combine `sbt` commands to save on startup time
  - Publish to codecov using a CircleCI orb
  - Use `exec` to close out `stdin`
  • Loading branch information
jeffmay committed Feb 18, 2022
1 parent 7f7b57f commit 6de9060
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
15 changes: 10 additions & 5 deletions .circleci/config.yml
@@ -1,6 +1,9 @@
# Scala CircleCI 2.0 configuration file
# Scala CircleCI 2.x configuration file
# See: https://circleci.com/docs/2.0/sample-config/
version: 2
version: '2.1'

orbs:
codecov: codecov/codecov@3.2.2

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
Expand Down Expand Up @@ -36,12 +39,14 @@ jobs:
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: cat /dev/null | sbt 'Test / compile'
# Compile, run tests, and produce coverage reports!
- run: exec 0<&- && sbt clean coverage test coverageReport coverageAggregate shutdown

# Save cached artifacts
- save_cache:
paths:
- ~/.m2
key: v1-dependencies--{{ checksum "build.sbt" }}

# run tests!
- run: cat /dev/null | sbt test
# Upload the coverage reports codecov using the secure Orb
- codecov/upload
12 changes: 5 additions & 7 deletions codecov.yml
@@ -1,17 +1,15 @@
codecov:
ci:
- "circleci.com"

coverage:
# TODO: Use better coverage configs after adding better unit test coverage
status:
patch:
default:
target: 50%
threshold: 0%
branches:
- master
- prototype
project:
default:
# TODO: Use better coverage configs after adding better unit test coverage
target: 50%
threshold: 0%
branches:
- master
- prototype
2 changes: 1 addition & 1 deletion project/plugins.sbt
@@ -1,5 +1,5 @@
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.0-M4")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10")

0 comments on commit 6de9060

Please sign in to comment.