From 77b6682e9ed019a32ba61f5276d5ae90dd634466 Mon Sep 17 00:00:00 2001 From: Leo Benkel Date: Fri, 2 Dec 2022 12:32:01 +0100 Subject: [PATCH 1/5] Enable test coverage report to coveralls --- .github/workflows/cicd.yaml | 2 +- build.sbt | 7 +++---- project/plugins.sbt | 5 +++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index a458905..caa04f4 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -57,7 +57,7 @@ jobs: - name: test coverage # TODO: Use coveralls - run: echo "test coverage" + run: sbt coverageReport coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/build.sbt b/build.sbt index eb99702..d1851f6 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = project .in(file(".")) .enablePlugins(GitVersioning) -. enablePlugins(BuildInfoPlugin) + .enablePlugins(BuildInfoPlugin) .settings( scalaVersion := "2.13.10", name := "Typed Graph", @@ -26,13 +26,12 @@ lazy val root = "-Ywarn-unused:params", "-Ywarn-unused:locals", "-Ywarn-value-discard", "-Ywarn-unused:privates", ), - - + coverageEnabled := true, // 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", diff --git a/project/plugins.sbt b/project/plugins.sbt index a756beb..03714c2 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -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") From 923d7c5e15e5bff7fceed4b7c28236dbd4a38ced Mon Sep 17 00:00:00 2001 From: Leo Benkel Date: Fri, 2 Dec 2022 12:39:57 +0100 Subject: [PATCH 2/5] Try again --- .github/workflows/cicd.yaml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index caa04f4..502e5c9 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -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 @@ -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 @@ -56,7 +71,6 @@ jobs: job_summary: false - name: test coverage - # TODO: Use coveralls run: sbt coverageReport coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} From a39d114da5cd406f9a50d631954f4f8e545fa479 Mon Sep 17 00:00:00 2001 From: Leo Benkel Date: Fri, 2 Dec 2022 12:49:43 +0100 Subject: [PATCH 3/5] try --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index d1851f6..6293dec 100644 --- a/build.sbt +++ b/build.sbt @@ -27,6 +27,7 @@ lazy val root = "-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, From 3bb02f3d69a366fc5ef85b988e5219cda1bc06b1 Mon Sep 17 00:00:00 2001 From: Leo Benkel Date: Fri, 2 Dec 2022 13:09:37 +0100 Subject: [PATCH 4/5] test --- .github/workflows/cicd.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 502e5c9..8b5351e 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -16,19 +16,19 @@ jobs: steps: # 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 }} +# - 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 From c2c2e61fa15a0771ffff9287a23862b322bd1aa6 Mon Sep 17 00:00:00 2001 From: Leo Benkel Date: Fri, 2 Dec 2022 13:19:00 +0100 Subject: [PATCH 5/5] update readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 6fcd6bf..6e29ae3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # TypedGraph +[![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**. For more information, read the [white paper](https://github.com/NikinAI/TypedGraph/tree/main/docs).