Scala coverage example
33
stars
36
commits
Scala
primary language
May 22, 2026
updated
You should first get the repository upload token from codecov
Add the following to your .github/workflows/test.yml file.
name: Test workflow
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
name: Test scala
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '21'
- name: Run tests
run: sbt coverage test coverageReport
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
Here we frist checkout the code, then setup java, run the tests and generate the coverage report. Finally, we upload the report to codecov using the codecov-action.
When all finished, you could also add a badge on readme like following.
[](https://codecov.io/gh/YOUR_ACCOUNT/YOUR_REPO)
scoverage to plugin listaddSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11") as seen herecoverage and coverageReport to sbtsbt clean coverage test coverageReport as seen hereRepository tokens are required for
Find your repository token at Codecov and provide via appending -t <your upload token> to you where you upload reports.
Scala
100.0%
Scala coverage example
33
stars
36
commits
Scala
primary language
May 22, 2026
updated
You should first get the repository upload token from codecov
Add the following to your .github/workflows/test.yml file.
name: Test workflow
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
name: Test scala
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '21'
- name: Run tests
run: sbt coverage test coverageReport
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
Here we frist checkout the code, then setup java, run the tests and generate the coverage report. Finally, we upload the report to codecov using the codecov-action.
When all finished, you could also add a badge on readme like following.
[](https://codecov.io/gh/YOUR_ACCOUNT/YOUR_REPO)
scoverage to plugin listaddSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11") as seen herecoverage and coverageReport to sbtsbt clean coverage test coverageReport as seen hereRepository tokens are required for
Find your repository token at Codecov and provide via appending -t <your upload token> to you where you upload reports.
Scala
100.0%