Skip to content

Commit e6e817d

Browse files
committed
set up github action for CI build and codecov
add build and codecov badge in README.md
1 parent 01d118f commit e6e817d

File tree

4 files changed

+76
-1
lines changed

4 files changed

+76
-1
lines changed

.github/workflows/codecov.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Codecov
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
pull_request:
10+
11+
12+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13+
jobs:
14+
# This workflow contains a single job called "build"
15+
build:
16+
# The type of runner that the job will run on
17+
runs-on: ubuntu-latest
18+
19+
# Steps represent a sequence of tasks that will be executed as part of the job
20+
steps:
21+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22+
- uses: actions/checkout@v2
23+
24+
- name: Run cobertura
25+
run: mvn cobertura:cobertura
26+
27+
- name: Upload report
28+
run: bash <(curl -s https://codecov.io/bash)

.github/workflows/maven.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Build
5+
6+
on:
7+
push:
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
java: [7, 8, 9.0.x, 10, 11, 12, 13]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Set up JDK
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: ${{ matrix.java }}
26+
27+
- name: Clean Build
28+
run: mvn clean
29+
30+
- name: Build with Maven
31+
run: mvn -B package --file pom.xml

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ java-xmlbuilder
33

44
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.jamesmurty.utils/java-xmlbuilder/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.jamesmurty.utils/java-xmlbuilder)
55

6+
![Build](https://github.com/jmurty/java-xmlbuilder/workflows/Build/badge.svg) ![Codecov](https://github.com/jmurty/java-xmlbuilder/workflows/Codecov/badge.svg)
7+
8+
[![codecov](https://codecov.io/gh/jmurty/java-xmlbuilder/branch/master/graph/badge.svg)](https://codecov.io/gh/jmurty/java-xmlbuilder)
9+
610
XML Builder is a utility that allows simple XML documents to be constructed
711
using relatively sparse Java code.
812

pom.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,19 @@
106106
</execution>
107107
</executions>
108108
</plugin>
109-
109+
110+
<plugin>
111+
<groupId>org.codehaus.mojo</groupId>
112+
<artifactId>cobertura-maven-plugin</artifactId>
113+
<version>2.7</version>
114+
<configuration>
115+
<formats>
116+
<format>html</format>
117+
<format>xml</format>
118+
</formats>
119+
<check />
120+
</configuration>
121+
</plugin>
110122
</plugins>
111123
</build>
112124

0 commit comments

Comments
 (0)