Skip to content

Commit 35136eb

Browse files
committed
- coveralls testing
1 parent d1f852c commit 35136eb

File tree

6 files changed

+84
-8
lines changed

6 files changed

+84
-8
lines changed

.github/workflows/maven-build.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
# maven-build.yml
2-
31
name: maven-build
2+
43
on:
54
pull_request:
65
push:
76
branches:
87
- main
98
workflow_dispatch:
9+
1010
jobs:
11+
runs-on: ubuntu-latest
12+
log-env:
13+
steps:
14+
- id: env
15+
run: env | sort -n
16+
1117
build-main:
12-
uses: dangernoodle-io/.github/.github/workflows/maven-build.yml@jae/initial
13-
secrets: inherit
18+
uses: dangernoodle-io/.github/.github/workflows/maven.yml@main
19+
with:
20+
maven-goals: verify

.github/workflows/maven-release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
# maven-release.yml
2-
31
name: maven-release
2+
43
on:
54
workflow_dispatch:
5+
66
jobs:
77
build-main:
88
uses: dangernoodle-io/.github/.github/workflows/maven-release.yml@jae/initial
9+
release-main:
910
secrets: inherit
11+
uses: dangernoodle-io/.github/.github/workflows/maven.yml@main
12+
with:
13+
maven-goals: release:prepare release:perform
14+
release: true

hello-dangernoodle-module-a/pom.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34

45
<modelVersion>4.0.0</modelVersion>
56

@@ -11,4 +12,25 @@
1112

1213
<artifactId>hello-dangernoodle-module-a</artifactId>
1314

15+
<build>
16+
<plugins>
17+
<plugin>
18+
<groupId>org.jacoco</groupId>
19+
<artifactId>jacoco-maven-plugin</artifactId>
20+
</plugin>
21+
<plugin>
22+
<groupId>com.github.hazendaz.maven</groupId>
23+
<artifactId>coveralls-maven-plugin</artifactId>
24+
</plugin>
25+
</plugins>
26+
</build>
27+
28+
<dependencies>
29+
<dependency>
30+
<groupId>org.junit.jupiter</groupId>
31+
<artifactId>junit-jupiter</artifactId>
32+
<scope>test</scope>
33+
</dependency>
34+
</dependencies>
35+
1436
</project>

hello-dangernoodle-module-a/src/main/java/io/dangernoodle/dummy/HelloWorldModuleA.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
*/
66
public class HelloWorldModuleA
77
{
8+
public boolean foo()
9+
{
10+
return true;
11+
}
12+
813
public static void main(String[] args)
914
{
1015
System.out.println("hello world");
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.dangernoodle.dummy;
2+
3+
import static org.junit.jupiter.api.Assertions.assertTrue;
4+
5+
import org.junit.jupiter.api.BeforeEach;
6+
import org.junit.jupiter.api.Test;
7+
8+
public class HelloWorldModuleATest
9+
{
10+
private HelloWorldModuleA moduleA;
11+
12+
@BeforeEach
13+
public void setup()
14+
{
15+
moduleA = new HelloWorldModuleA();
16+
}
17+
18+
@Test
19+
public void testFoo()
20+
{
21+
assertTrue(moduleA.foo());
22+
}
23+
}

pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.dangernoodle</groupId>
88
<artifactId>dangernoodle-io-build-pom</artifactId>
9-
<version>14</version>
9+
<version>14.1.0-SNAPSHOT</version>
1010
<relativePath />
1111
</parent>
1212

@@ -27,6 +27,8 @@
2727
<properties>
2828
<javadoc.project.artifactId>hello-dangernoodle</javadoc.project.artifactId>
2929
<javadoc.site.scm>scm:git:git@github.com:dangernoodle-io/hello-dangernoodle.git</javadoc.site.scm>
30+
31+
<junit.version>5.11.0</junit.version>
3032
</properties>
3133

3234
<scm>
@@ -41,4 +43,16 @@
4143
<url>https://github.com/dangernoodle-io/hello-dangernoodle/issues</url>
4244
</issueManagement>
4345

46+
<dependencyManagement>
47+
<dependencies>
48+
<dependency>
49+
<groupId>org.junit</groupId>
50+
<artifactId>junit-bom</artifactId>
51+
<version>${junit.version}</version>
52+
<type>pom</type>
53+
<scope>import</scope>
54+
</dependency>
55+
</dependencies>
56+
</dependencyManagement>
57+
4458
</project>

0 commit comments

Comments
 (0)