Skip to content

Commit a7ccff0

Browse files
Setup Github actions (#1)
* add release workflow * Setup release and PR flows * Add codecov step * Add coverage profile and fix path * Rename workflow
1 parent 5d8907d commit a7ccff0

File tree

3 files changed

+98
-14
lines changed

3 files changed

+98
-14
lines changed

.github/workflows/maven.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
3+
4+
name: maven
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
- 'releases/*'
11+
- 'refs/tags/*'
12+
pull_request:
13+
branches:
14+
- master
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up JDK 1.11
24+
uses: actions/setup-java@v1
25+
with:
26+
java-version: 1.11
27+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
28+
settings-path: ${{ github.workspace }} # location for the settings.xml file
29+
30+
- name: Build with Maven
31+
env:
32+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
33+
run: |
34+
mvn clean verify -Pcoverage -Ppack --file pom.xml --batch-mode -Dsytle.colors=always --errors
35+
bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -F unittests -f ./target/site/jacoco/jacoco.xml -n codecov-umbrella

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ target
1919
.#*
2020

2121
dependency-reduced-pom.xml
22+
.factorypath
23+
.classpath
24+
.project
25+
.settings/

pom.xml

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,65 @@
246246
</dependency>
247247
</dependencies>
248248

249+
<profiles>
250+
<profile>
251+
<id>coverage</id>
252+
<build>
253+
<plugins>
254+
<plugin>
255+
<groupId>org.jacoco</groupId>
256+
<artifactId>jacoco-maven-plugin</artifactId>
257+
<version>0.8.5</version>
258+
<configuration>
259+
<!--Configure to work on codecov-->
260+
<!--https://github.com/codecov/example-java/blob/master/pom.xml-->
261+
<excludes>
262+
<exclude>**/*Builder*</exclude>
263+
<exclude>**/*Immutable*</exclude>
264+
<exclude>**/*_Factory*</exclude>
265+
<exclude>**/*_*Factory*.*</exclude>
266+
<exclude>**/generated-sources*.*</exclude>
267+
</excludes>
268+
<rules>
269+
<rule implementation="org.jacoco.maven.RuleConfiguration">
270+
<element>BUNDLE</element>
271+
<limits>
272+
<limit implementation="org.jacoco.report.check.Limit">
273+
<counter>INSTRUCTION</counter>
274+
<value>COVEREDRATIO</value>
275+
<minimum>0.60</minimum>
276+
</limit>
277+
</limits>
278+
</rule>
279+
</rules>
280+
</configuration>
281+
<executions>
282+
<execution>
283+
<id>pre-test</id>
284+
<goals>
285+
<goal>prepare-agent</goal>
286+
</goals>
287+
</execution>
288+
<execution>
289+
<id>default-check</id>
290+
<goals>
291+
<goal>check</goal>
292+
</goals>
293+
</execution>
294+
<execution>
295+
<id>post-unit-test</id>
296+
<phase>test</phase>
297+
<goals>
298+
<goal>report</goal>
299+
</goals>
300+
</execution>
301+
</executions>
302+
</plugin>
303+
</plugins>
304+
</build>
305+
</profile>
306+
</profiles>
307+
249308
<build>
250309
<plugins>
251310
<plugin>
@@ -333,20 +392,6 @@
333392
<version>4.0.0</version>
334393
<artifactId>spotbugs-maven-plugin</artifactId>
335394
</plugin>
336-
<plugin>
337-
<groupId>org.jacoco</groupId>
338-
<artifactId>jacoco-maven-plugin</artifactId>
339-
<version>0.8.5</version>
340-
<configuration>
341-
<excludes>
342-
<exclude>**/*Builder*</exclude>
343-
<exclude>**/*Immutable*</exclude>
344-
<exclude>**/*_Factory*</exclude>
345-
<exclude>**/*_*Factory*.*</exclude>
346-
<exclude>**/generated-sources*.*</exclude>
347-
</excludes>
348-
</configuration>
349-
</plugin>
350395
<plugin>
351396
<groupId>com.coveo</groupId>
352397
<artifactId>fmt-maven-plugin</artifactId>

0 commit comments

Comments
 (0)