You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/06/13 13:11:18 UTC

[commons-math] branch master updated: Add aggregate coverage report

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git


The following commit(s) were added to refs/heads/master by this push:
     new e85dd5999 Add aggregate coverage report
e85dd5999 is described below

commit e85dd59990a3b47793f5a26ac27e88a9f5ee9e53
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Jun 13 14:11:11 2022 +0100

    Add aggregate coverage report
    
    This is used to report coverage across all modules for the multi-module
    project, e.g. use of the legacy.exception and jdkmath packages.
---
 .github/workflows/coverage.yml |   7 ++-
 docs-archive/pom.xml           | 113 +++++++++++++++++++++++++++++++++++++++++
 pom.xml                        |   8 +++
 3 files changed, 124 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 0173b69eb..c73b24e03 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -41,11 +41,10 @@ jobs:
       with:
         distribution: adopt
         java-version: ${{ matrix.java }}
-    - name: Build with Maven
-      run: mvn -V test jacoco:report --no-transfer-progress
+    - name: Build with Maven including the docs-archive module using a profile
+      run: mvn -V -Pdocs test jacoco:report-aggregate --no-transfer-progress
 
     - name: Upload coverage to Codecov
       uses: codecov/codecov-action@v3
       with:
-        # commons-math-core module current skips jacoco report
-        files: ./commons-math-neuralnet/target/site/jacoco/jacoco.xml,./commons-math-transform/target/site/jacoco/jacoco.xml,./commons-math-legacy-exception/target/site/jacoco/jacoco.xml,./commons-math-legacy-core/target/site/jacoco/jacoco.xml,./commons-math-legacy/target/site/jacoco/jacoco.xml
+        files: ./docs-archive/target/site/jacoco-aggregate/jacoco.xml
diff --git a/docs-archive/pom.xml b/docs-archive/pom.xml
new file mode 100644
index 000000000..2773605e5
--- /dev/null
+++ b/docs-archive/pom.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.commons</groupId>
+    <artifactId>commons-math-parent</artifactId>
+    <version>4.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>commons-math-docs</artifactId>
+  <!-- do not set packaging to pom, because otherwise we will receive 
+       "Not executing Javadoc as the project is not a Java classpath-capable package" -->
+
+  <name>Apache Commons Math Documentation</name>
+  <description>Aggregator module to genenerate Apache Commons Math documentation.</description>
+
+  <properties>
+    <checkstyle.skip>true</checkstyle.skip>
+    <animal.sniffer.skip>true</animal.sniffer.skip>
+    <!-- Workaround to avoid duplicating config files. -->
+    <math.parent.dir>${basedir}/..</math.parent.dir>
+    <!-- Skip build defaults -->
+    <jdepend.skip>true</jdepend.skip>
+    <maven.source.skip>true</maven.source.skip>
+    <maven.deploy.skip>true</maven.deploy.skip>
+    <!-- Simple site -->
+    <spotbugs.skip>true</spotbugs.skip>
+    <pmd.skip>true</pmd.skip>
+    <checkstyle.skip>true</checkstyle.skip>
+    <changes.jira.skip>true</changes.jira.skip>
+    <skipSurefireReport>true</skipSurefireReport>
+  </properties>
+
+  <!-- Depend on all other modules -->
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math4-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math4-neuralnet</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math4-transform</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math4-legacy-exception</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math4-legacy-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math4-legacy</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+  <reporting>
+    <plugins>
+      <!-- Create an aggregate report from the *parent* directory using:
+
+           mvn jacoco:report-aggregate -P docs
+
+           Requires that 'mvn test' has already been run with the jacoco user agent.
+           If executed within this directory then jacoco does not collect the
+           executions from the module dependencies. -->
+      <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+        <version>${commons.jacoco.version}</version>
+        <configuration>
+          <title>Apache Commons Math</title>
+          <footer>Code Coverage Report for Apache Commons Math ${project.version}</footer>
+        </configuration>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>report-aggregate</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+
+</project>
diff --git a/pom.xml b/pom.xml
index 5007e5de3..420fa8b82 100644
--- a/pom.xml
+++ b/pom.xml
@@ -860,6 +860,14 @@ This is avoided by creating an empty directory when svn is not available.
         <module>dist-archive</module>
       </modules>
     </profile>
+
+    <profile>
+      <!-- Include an aggregate module to build test coverage reports -->
+      <id>docs</id>
+      <modules>
+        <module>docs-archive</module>
+      </modules>
+    </profile>
   </profiles>
 
   <developers>