Skip to content

Commit

Permalink
Upload test code coverage to coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-stanchev authored and MiroslavGatsanoga committed Feb 3, 2022
1 parent ef8943b commit fcd2322
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 37 deletions.
23 changes: 15 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,24 @@ workflows:
jobs:
build:
docker:
- image: docker:stable-git
- image: cimg/openjdk:8.0
steps:
- checkout
- setup_remote_docker
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
- v1-dependencies-
- run:
name: Build package, run tests and upload test coverage
command: |
mkdir -p ~/.m2/
curl -v -o ~/.m2/settings.xml "https://raw.githubusercontent.com/Financial-Times/nexus-settings/master/public-settings.xml"
mvn clean package jacoco:report-aggregate coveralls:report -Djava.net.preferIPv4Stack=true -DrepoToken=${COVERALLS_TOKEN}
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
- run:
name: Set Docker image tag based on branch or git tag
command: |
Expand All @@ -33,10 +47,3 @@ jobs:
--build-arg SONATYPE_PASSWORD=${SONATYPE_PASSWORD} \
--build-arg GIT_TAG=${DOCKER_TAG} \
--tag nexus.in.ft.com:5000/coco/${CIRCLE_PROJECT_REPONAME}:${DOCKER_TAG} .
- deploy:
name: Push Docker image
command: |
source ${BASH_ENV}
docker login nexus.in.ft.com:5000 -u ${DOCKER_USER} -p ${DOCKER_PASSWORD}
docker push nexus.in.ft.com:5000/coco/${CIRCLE_PROJECT_REPONAME}:${DOCKER_TAG}
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Api Policy Component
====================
[![CircleCI](https://circleci.com/gh/Financial-Times/api-policy-component.svg?style=shield)](https://circleci.com/gh/Financial-Times/api-policy-component)
[![Coverage Status](https://coveralls.io/repos/github/Financial-Times/api-policy-component/badge.svg?branch=master)](https://coveralls.io/github/Financial-Times/api-policy-component?branch=master)

An HTTP service provides a facade over the reader endpoint for use by licenced partners.

Expand Down
48 changes: 20 additions & 28 deletions api-policy-component-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<url>http://www.ft.com</url>
<inceptionYear>2014</inceptionYear>
<properties>
<surefire.reportplugin.version>2.22.2</surefire.reportplugin.version>
<maven-jar-plugin.version>2.3.2</maven-jar-plugin.version>
<maven-source-plugin.version>2.2.1</maven-source-plugin.version>
<maven-shade-plugin.version>.</maven-shade-plugin.version>
Expand All @@ -25,8 +24,8 @@
<maven-jxr-plugin.version>2.3</maven-jxr-plugin.version>
<target-jdk>1.8</target-jdk>
<mockito-core.version>1.9.5</mockito-core.version>
<jacoco-maven-plugin.version>0.7.4.201502262128</jacoco-maven-plugin.version>
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
<jacoco-maven-plugin.version>0.7.7.201606060606</jacoco-maven-plugin.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -195,25 +194,25 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
Expand Down Expand Up @@ -369,13 +368,6 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${surefire.reportplugin.version}</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven-pmd-plugin.version}</version>
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ services:
SONATYPE_PASSWORD: ${SONATYPE_PASSWORD}
volumes:
- ~/.m2/repository:/root/.m2/repository
command: ["mvn", "test"]
command: ["mvn", "test", "clean", "package", "jacoco:report", "coveralls:report"]
49 changes: 49 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,53 @@
<module>api-policy-component-service</module>
<module>api-policy-component-json-schema</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco-maven-plugin.version>0.7.7.201606060606</jacoco-maven-plugin.version>
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
</properties>
<build>
<finalName>ParentPOM</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>${coveralls-maven-plugin.version}</version>
<configuration>
<jacocoReports>
<jacocoReport>${project.basedir}/api-policy-component-service/target/site/jacoco/jacoco.xml</jacocoReport>
</jacocoReports>
</configuration>
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

0 comments on commit fcd2322

Please sign in to comment.