Skip to content

Commit 61f10d4

Browse files
author
Anders Breid
authored
Add codacy style check and test coverage (#32)
* Add codacy style check and test coverage
1 parent a6dff7b commit 61f10d4

File tree

4 files changed

+39
-31
lines changed

4 files changed

+39
-31
lines changed

.codacy.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
exclude_paths:
2+
- 'wiki/**'
3+
- '.github/**'
4+
- 'CODE_OF_CONDUCT.md'
5+
- 'CONTRIBUTING.md'

.travis.yml

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
sudo: required
2-
32
dist: xenial
4-
53
language: java
64

7-
# services:
8-
# - docker
9-
105
env:
116
- JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
127

13-
# Run before every job
148
before_install:
159
- sudo apt-get update
1610
- sudo apt-get install -y openjdk-8-jdk
@@ -19,30 +13,12 @@ before_install:
1913
- uname -a
2014
- chmod +x pom.xml
2115

22-
23-
# This is only run before integrationTests job
24-
# To ensure docker containers are fully up and running we sleep 20s
25-
# before_script:
26-
# - cd src/main/docker/
27-
# - source env.bash
28-
# - docker-compose up -d
29-
# - sleep 60
30-
# - cd ../../../
31-
32-
33-
# Generate site documentation using mvn site plugin
34-
# before_deploy:
35-
# - rm -rf docs
36-
# - mvn site -B
37-
38-
3916
# Using default stage 'test' for all our test jobs, and only running deploy stage
4017
# (after merge) to master branch
4118
stages:
4219
- test
43-
# - name: deploy
44-
# if: branch = master
45-
20+
- name: report_coverage
21+
if: branch = master AND type != pull_request
4622

4723
# List of jobs to run, tied to specific stages
4824
jobs:
@@ -52,3 +28,11 @@ jobs:
5228
before_script: skip
5329
script:
5430
- mvn test -B
31+
- stage: report_coverage
32+
name: report_coverage
33+
# Generating test coverage report and publishing to Codacy
34+
script:
35+
- CODACY_COVERAGE_REPORTER_VERSION=6.0.2
36+
- mvn cobertura:cobertura -B
37+
- curl -Ls -o codacy-coverage-reporter-assembly.jar https://github.com/codacy/codacy-coverage-reporter/releases/download/$CODACY_COVERAGE_REPORTER_VERSION/codacy-coverage-reporter-$CODACY_COVERAGE_REPORTER_VERSION-assembly.jar
38+
- java -jar codacy-coverage-reporter-assembly.jar report -l Java -r target/site/cobertura/coverage.xml

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,23 @@
1818
<img src="./images/logo.png" alt="Eiffel Shared Java" width="350"/>
1919

2020
[![Build Status](https://travis-ci.org/eiffel-community/eiffel-commons.svg?branch=master)](https://travis-ci.org/eiffel-community/eiffel-commons)
21+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d22bd08ce36a4f43b8d21ede2848ce81)](https://www.codacy.com/app/eiffel-commons-maintainers/eiffel-commons?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=eiffel-community/eiffel-commons&amp;utm_campaign=Badge_Grade)
22+
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/d22bd08ce36a4f43b8d21ede2848ce81)](https://www.codacy.com/app/eiffel-commons-maintainers/eiffel-commons?utm_source=github.com&utm_medium=referral&utm_content=eiffel-community/eiffel-commons&utm_campaign=Badge_Coverage)
2123
[![](https://jitpack.io/v/eiffel-community/eiffel-commons.svg)](https://jitpack.io/#eiffel-community/eiffel-commons)
2224

2325
# Eiffel Commons
2426
## Java Library
25-
* Jenkins Manager
26-
* RegExProvider
27-
* Subsceription object
27+
* Jenkins Manager
28+
* RegExProvider
29+
* Subscription object
30+
* HttpRequest
2831

29-
# About this repository
32+
## About this repository
3033
The contents of this repository are licensed under the [Apache License 2.0](./LICENSE).
3134

3235
To get involved, please see [Code of Conduct](./CODE_OF_CONDUCT.md) and [contribution guidelines](./CONTRIBUTING.md).
3336

34-
# About Eiffel
37+
## About Eiffel
3538
This repository forms part of the Eiffel Community. Eiffel is a protocol for technology agnostic machine-to-machine communication in continuous integration and delivery pipelines, aimed at securing scalability, flexibility and traceability. Eiffel is based on the concept of decentralized real time messaging, both to drive the continuous integration and delivery system and to document it.
3639

3740
Visit [Eiffel Community](https://eiffel-community.github.io) to get started and get involved.

pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,20 @@
7070
<scope>test</scope>
7171
</dependency>
7272
</dependencies>
73+
74+
<build>
75+
<plugins>
76+
<plugin>
77+
<groupId>org.codehaus.mojo</groupId>
78+
<artifactId>cobertura-maven-plugin</artifactId>
79+
<version>2.7</version>
80+
<configuration>
81+
<formats>
82+
<format>html</format>
83+
<format>xml</format>
84+
</formats>
85+
</configuration>
86+
</plugin>
87+
</plugins>
88+
</build>
7389
</project>

0 commit comments

Comments
 (0)