Skip to content

Commit

Permalink
Automated Build Process (Travis CI) (#2)
Browse files Browse the repository at this point in the history
* add travis and codecov

* add badges

* remove settings.xml

* add settings.xml

* Add jacoco to pom.xml

* add Sonar

* Update pom.xml

Thanks Marco!

Co-Authored-By: Marco Rizzi <[email protected]>
  • Loading branch information
carlosthe19916 and mrizzi committed Jul 4, 2019
1 parent a8d2137 commit 7eb78fe
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: java
notifications:
email: false
jdk:
- openjdk8
addons:
sonarcloud:
organization: project-xavier
token:
secure: $SONAR_TOKEN
install:
- cp ./configuration/settings.xml $HOME/.m2/settings.xml
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
jobs:
include:
- stage: Test
script:
- mvn test -Pcoverage
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sonar-scanner; fi'
- bash <(curl -s https://codecov.io/bash)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![Build Status](https://travis-ci.org/project-xavier/xavier-analytics.svg?branch=master)](https://travis-ci.org/project-xavier/xavier-analytics)
[![codecov](https://codecov.io/gh/project-xavier/xavier-analytics/branch/master/graph/badge.svg)](https://codecov.io/gh/project-xavier/xavier-analytics)

# xavier-analytics

## How to create a new rule set for an agenda group with test
Expand Down
56 changes: 56 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,60 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<configuration>
<excludes>
<exclude>**org.drools.compiler*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>jacoco-prepare</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-post-unit-test-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.1</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
31 changes: 31 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
sonar.projectKey=project-xavier_xavier-analytics
sonar.projectName=Xavier Analytics

# =====================================================
# Meta-data for the project
# =====================================================

sonar.links.homepage=https://github.com/project-xavier/xavier-analytics
sonar.links.ci=https://travis-ci.org/project-xavier/xavier-analytics
sonar.links.scm=https://github.com/project-xavier/xavier-analytics
sonar.links.issue=https://github.com/project-xavier/xavier-analytics/issues

# =====================================================
# Properties that will be shared amongst all modules
# =====================================================

sonar.host.url=https://sonarcloud.io
sonar.organization=project-xavier
sonar.sources=src

# =====================================================
# Java config
# =====================================================
sonar.java.source=1.8
sonar.java.binaries=.

# =====================================================
# Source Analysis
# =====================================================
sonar.exclusions=**/*Test.java
sonar.test.exclusions=**/*Test.java

0 comments on commit 7eb78fe

Please sign in to comment.