Skip to content

Enable test coverage report to coveralls #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
# https://github.com/scoverage/sbt-coveralls#github-actions-integration
# - name: Git checkout (merge)
- uses: actions/checkout@v3
# if: github.event_name != 'pull_request'
# with:
# fetch-depth: 0
#
# - name: Git checkout (PR)
# uses: actions/checkout@v3
# if: github.event_name == 'pull_request'
# with:
# fetch-depth: 0
# # see: https://frontside.com/blog/2020-05-26-github-actions-pull_request/#how-does-pull_request-affect-actionscheckout
# ref: ${{ github.event.pull_request.head.sha }}
###

- uses: olafurpg/setup-scala@v13

- name: Cache sbt
Expand All @@ -30,8 +45,8 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: test
run: sbt ";clean;Test/compile;test"
- name: run tests
run: sbt ";clean;Test/compile;coverage;test"

- name: detailed test reporting
uses: dorny/test-reporter@v1
Expand All @@ -56,8 +71,7 @@ jobs:
job_summary: false

- name: test coverage
# TODO: Use coveralls
run: echo "test coverage"
run: sbt coverageReport coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![Latest Release](https://badgen.net/github/release/NikinAI/TypedGraph)](https://github.com/NikinAI/TypedGraph/packages)

[![Coverage Status](https://coveralls.io/repos/github/NikinAI/TypedGraph/badge.svg?branch=main)](https://coveralls.io/github/NikinAI/TypedGraph?branch=main)

---

A library to describe **Typed Condensed Oriented Directed Acyclic Planar Multigraphs**.
Expand Down
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root =
project
.in(file("."))
.enablePlugins(GitVersioning)
. enablePlugins(BuildInfoPlugin)
.enablePlugins(BuildInfoPlugin)
.settings(
scalaVersion := "2.13.10",
name := "Typed Graph",
Expand All @@ -26,13 +26,13 @@ lazy val root =
"-Ywarn-unused:params", "-Ywarn-unused:locals", "-Ywarn-value-discard",
"-Ywarn-unused:privates",
),


coverageEnabled := true,
CoverallsKeys.coberturaFile := crossTarget.value / "coverage-report" / "cobertura.xml",

// https://github.com/target/data-validator/blob/d3ae90ea1c84d922e50ad097f517e44852711c1c/build.sbt#LL11-L12C27
git.useGitDescribe := true,
// https://github.com/target/data-validator/blob/d3ae90ea1c84d922e50ad097f517e44852711c1c/build.sbt#LL27
publishTo := githubPublishTo.value,
publishTo := githubPublishTo.value,

// https://github.com/djspiewak/sbt-github-packages#usage
githubOwner := "NikinAI",
Expand Down
5 changes: 5 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
// https://github.com/target/data-validator/blob/d3ae90ea1c84d922e50ad097f517e44852711c1c/project/plugins.sbt#LL3
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

// https://github.com/scoverage/sbt-scoverage
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.5")
// https://github.com/scoverage/sbt-coveralls
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.3")