Skip to content

Commit 52138f8

Browse files
committed
JaCoCo CI workflow added with support of Morana OSS
1 parent b6a8ffd commit 52138f8

File tree

10 files changed

+721
-195
lines changed

10 files changed

+721
-195
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: JaCoCo Report
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
types: [ opened, edited, synchronize, reopened ]
7+
8+
env:
9+
scalaLong: 2.13.11
10+
scalaShort: "2.13"
11+
coverage-overall: 80.0
12+
coverage-changed-files: 80.0
13+
coverage-per-changed-file: 0.0
14+
check-overall-coverages: true
15+
MODULES: |
16+
statusboard-model: model
17+
statusboard-repository: repository
18+
statusboard-utils: utils
19+
statusboard-providers: providers
20+
statusboard-checker: checker
21+
statusboard-api-controllers: api/controllers
22+
statusboard-notification-actioners: notification/actioners
23+
statusboard-notification-deciders: notification/deciders
24+
statusboard-monitoring: monitoring
25+
statusboard-notification: notification
26+
MODULES_THRESHOLDS: |
27+
statusboard-model: 35*80*
28+
statusboard-repository: 35*80*
29+
statusboard-utils: 35*80*
30+
statusboard-providers: 35*80*
31+
statusboard-checker: 35*80*
32+
statusboard-api-controllers: 35*80*
33+
statusboard-notification-actioners: 35*80*
34+
statusboard-notification-deciders: 35*80*
35+
statusboard-monitoring: 35*80*
36+
statusboard-notification: 35*80*
37+
38+
jobs:
39+
jacoco-report:
40+
name: JaCoCo Report
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- name: Checkout code
45+
id: code-checkout
46+
uses: actions/checkout@v4
47+
with:
48+
persist-credentials: false
49+
50+
- name: Setup JVM and SBT
51+
id: jvm-setup
52+
uses: coursier/[email protected]
53+
with:
54+
jvm: corretto:21.0.2.13.1
55+
apps: sbt
56+
57+
- name: Build and run tests with test coverage
58+
id: jacoco-run
59+
continue-on-error: true
60+
run: sbt jacoco
61+
env:
62+
AWS_REGION: "ignored"
63+
AWS_ACCESS_KEY_ID: "ignored"
64+
AWS_SECRET_ACCESS_KEY: "ignored"
65+
66+
- name: Publish JaCoCo Report in PR comments
67+
id: jacoco
68+
uses: MoranaApps/jacoco-report@v2
69+
with:
70+
token: '${{ secrets.GITHUB_TOKEN }}'
71+
paths: |
72+
**/target/**/jacoco/report/jacoco.xml
73+
exclude-paths: |
74+
database/target/**
75+
sensitivity: "detail"
76+
comment-mode: 'multi'
77+
min-coverage-overall: ${{ env.coverage-overall }}
78+
min-coverage-changed-files: ${{ env.coverage-changed-files }}
79+
min-coverage-per-changed-file: ${{ env.coverage-per-changed-file }}
80+
skip-unchanged: false
81+
modules: ${{ env.MODULES }}
82+
modules-thresholds: ${{ env.MODULES_THRESHOLDS }}
83+
84+
jacoco-report-server:
85+
name: JaCoCo Report on Server
86+
runs-on: ubuntu-latest
87+
services:
88+
dynamodb-local:
89+
image: "amazon/dynamodb-local:latest"
90+
ports:
91+
- "8000:8000"
92+
steps:
93+
- name: Checkout code
94+
id: code-checkout
95+
uses: actions/checkout@v4
96+
with:
97+
persist-credentials: false
98+
99+
- name: Setup JVM and SBT
100+
id: jvm-setup
101+
uses: coursier/[email protected]
102+
with:
103+
jvm: corretto:21.0.2.13.1
104+
apps: sbt
105+
106+
- name: Build and run tests with test coverage
107+
id: jacoco-run
108+
continue-on-error: true
109+
run: sbt jacoco
110+
env:
111+
AWS_REGION: "ignored"
112+
AWS_ACCESS_KEY_ID: "ignored"
113+
AWS_SECRET_ACCESS_KEY: "ignored"
114+
115+
- name: Check coverage thresholds and add reports in PR comments
116+
id: jacoco-report
117+
uses: MoranaApps/jacoco-report@v2
118+
with:
119+
token: '${{ secrets.GITHUB_TOKEN }}'
120+
paths: |
121+
**/target/**/jacoco/report/jacoco.xml
122+
exclude-paths: |
123+
database/target/**
124+
sensitivity: "detail"
125+
comment-mode: 'multi'
126+
min-coverage-overall: ${{ env.coverage-overall }}
127+
min-coverage-changed-files: ${{ env.coverage-changed-files }}
128+
min-coverage-per-changed-file: ${{ env.coverage-per-changed-file }}
129+
skip-unchanged: false
130+
modules: ${{ env.MODULES }}
131+
modules-thresholds: ${{ env.MODULES_THRESHOLDS }}

.github/workflows/status-board-tests.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.sbtrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ alias test=; testOnly *UnitTests
77
alias testDynamo=; testOnly *DynamoDBIntegrationTests
88
alias testSMTP=; testOnly *SMTPIntegrationTests
99
alias testMSTeams=; testOnly *MSTeamsIntegrationTests
10+
11+
# JaCoCo Aliases
12+
alias jacoco=; jacocoOn; +clean; +testOnly *UnitTests; jacocoReportAll; jacocoOff
13+
alias jacocoOff=; set every jacocoPluginEnabled := false
14+
alias jacocoOn=; set every jacocoPluginEnabled := true

build.sbt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* limitations under the License.
1515
*/
1616
import Dependencies.*
17-
import JacocoSetup.*
18-
1917
import scala.collection.Seq
2018

2119
ThisBuild / scalaVersion := Versions.scala213
@@ -57,8 +55,7 @@ lazy val root = (project in file("."))
5755
Test / parallelExecution := false,
5856
(assembly / test) := {},
5957
publish := {},
60-
jacocoReportSettings := jacocoSettings(scalaVersion.value, "status-board"),
61-
jacocoExcludes := jacocoProjectExcludes()
6258
)
6359
.enablePlugins(AutomateHeaderPlugin)
6460
.enablePlugins(AssemblyPlugin)
61+
.enablePlugins(FilteredJacocoAgentPlugin)

0 commit comments

Comments
 (0)