You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2022/12/16 04:07:26 UTC

[groovy] branch master updated: Enable codecov

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

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 8e5316b9a5 Enable codecov
8e5316b9a5 is described below

commit 8e5316b9a5b6f0f097c0a84a03bb48a1640b5683
Author: Daniel Sun <su...@apache.org>
AuthorDate: Fri Dec 16 12:05:37 2022 +0800

    Enable codecov
---
 .github/workflows/groovy-build-coverage.yml | 57 +++++++++++++++++++++++++++++
 README.adoc                                 |  8 +++-
 codecov.yml                                 | 35 ++++++++++++++++++
 3 files changed, 98 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/groovy-build-coverage.yml b/.github/workflows/groovy-build-coverage.yml
new file mode 100644
index 0000000000..776ad16c4c
--- /dev/null
+++ b/.github/workflows/groovy-build-coverage.yml
@@ -0,0 +1,57 @@
+# 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.
+
+name: Build and test for coverage
+
+on: [push, pull_request]
+
+permissions:
+  contents: read
+
+jobs:
+  test:
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-22.04]
+        java: [17]
+    runs-on: ${{ matrix.os }}
+    steps:
+      - uses: actions/checkout@v3
+      - name: Free disk space
+        run: |
+          echo "Removing large unused packages"
+          sudo apt-get remove -y azure-cli google-cloud-sdk microsoft-edge-stable google-chrome-stable powershell mono-devel >/dev/null 2>&1
+          sudo apt-get autoclean -y >/dev/null 2>&1
+          sudo apt-get clean -y >/dev/null 2>&1
+          sudo apt-get autoremove -y >/dev/null 2>&1
+
+          echo "Removing large unused files/directories"
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /usr/local/lib/node_modules /usr/local/share/powershell /usr/local/share/chromium
+          sudo rm -rf /opt/ghc /usr/local/share/boost "$AGENT_TOOLSDIRECTORY" /usr/local/graalvm /usr/local/.ghcup
+
+          sudo df -h
+      - name: Set up JDK
+        uses: actions/setup-java@v3
+        with:
+          distribution: 'zulu'
+          java-version: ${{ matrix.java }}
+          check-latest: true
+      - uses: gradle/gradle-build-action@v2
+      - name: Test with Gradle
+        run: ./gradlew -Pcoverage=true jacocoAllReport
+        timeout-minutes: 60
+      - name: Upload coverage to Codecov
+        uses: codecov/codecov-action@v3
diff --git a/README.adoc b/README.adoc
index 76a99f0300..e21f389840 100644
--- a/README.adoc
+++ b/README.adoc
@@ -31,6 +31,7 @@ The Groovy development team
 :github-ci: https://github.com/apache/groovy/actions?query=branch%3Amaster
 :sonarcloud: https://sonarcloud.io/dashboard?id=apache_groovy
 :jdk: https://www.oracle.com/technetwork/java/javase/downloads
+:codecov: https://codecov.io/gh/apache/groovy
 //:bintray-latest-version-image: https://api.bintray.com/packages/groovy/maven/groovy/images/download.png
 //:bintray-latest-version-link: https://bintray.com/groovy/maven/groovy/_latestVersion
 :apache-license-icon: https://img.shields.io/badge/license-APL2-blue.svg
@@ -38,6 +39,7 @@ The Groovy development team
 :apache-groovy-twitter-icon: https://img.shields.io/twitter/follow/ApacheGroovy.svg?style=social
 :apache-groovy-twitter-link: https://twitter.com/intent/follow?screen_name=ApacheGroovy
 :jdk-icon: https://img.shields.io/badge/java-11+-4c7e9f.svg
+:codecov-icon: https://codecov.io/gh/apache/groovy/branch/master/graph/badge.svg
 //:bintray-download-icon: https://api.bintray.com/packages/groovy/maven/groovy/images/download.svg
 :opencollective-link: https://opencollective.com/friends-of-groovy
 :sponsors-silver-img: https://opencollective.com/friends-of-groovy/tiers/silver-sponsor.svg?avatarHeight=45&width=890
@@ -45,14 +47,16 @@ The Groovy development team
 :backers-monthly-img: https://opencollective.com/friends-of-groovy/tiers/backer.svg?avatarHeight=36&width=890
 :backers-all-img: https://opencollective.com/friends-of-groovy/backers.svg?avatarHeight=32&width=890
 
+
 [.left.text-left]
 image::https://raw.githubusercontent.com/groovy/artwork/master/medium.png[]
 image:{jdk-icon}[jdk, link={jdk}]
 image:{apache-license-icon}[Apache License 2, link={apache-license-link}]
 image:{build-icon}[teamcity build status, link={groovy-ci}]
 image:{github-build-icon}[github build status, link={github-ci}]
-image:{sonarcloud-icon}[maintainability rating, link={sonarcloud}]
-//image:{bintray-download-icon}[bintray download, link={bintray-latest-version-link}]
+image:{codecov-icon}[codecov, link={codecov}]
+// image:{sonarcloud-icon}[maintainability rating, link={sonarcloud}]
+// image:{bintray-download-icon}[bintray download, link={bintray-latest-version-link}]
 image:{apache-groovy-twitter-icon}[follow on Twitter, link={apache-groovy-twitter-link}]
 
 {groovy-www}[Groovy] is a powerful multi-faceted programming language for the JVM platform.
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 0000000000..ff97f696c8
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,35 @@
+# 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.
+
+codecov:
+  require_ci_to_pass: yes
+
+comment:
+  layout: "reach, diff, flags, files"
+  behavior: default
+  require_changes: false
+  require_base: no
+  require_head: yes
+
+coverage:
+  status:
+    patch:
+      default:
+        target: auto
+        informational: true
+    project:
+      default:
+        target: auto
+        informational: true