From b3318fe9372e2ab7c9ddc070c2c9b24b1e8b25ee Mon Sep 17 00:00:00 2001 From: SteveYurongSu Date: Tue, 18 May 2021 23:18:46 +0800 Subject: [PATCH] Migrate CI to Github Actions and enable coverage report --- .coveralls.yml | 1 - .../workflows/{codeql-analysis.yml => ci.yml} | 30 +++++++++---------- .github/workflows/greetings.yml | 1 + .travis.yml | 15 ---------- README.md | 1 + README.zh-CN.md | 1 + build.gradle | 19 ++---------- docs/README.md | 1 + docs/cn/README.md | 1 + docs/en/README.md | 1 + 10 files changed, 23 insertions(+), 48 deletions(-) delete mode 100644 .coveralls.yml rename .github/workflows/{codeql-analysis.yml => ci.yml} (85%) delete mode 100644 .travis.yml diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index cf27a37024..0000000000 --- a/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -service_name: travis-pro diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/ci.yml similarity index 85% rename from .github/workflows/codeql-analysis.yml rename to .github/workflows/ci.yml index 9a46ed47f1..8ab4673208 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/ci.yml @@ -15,26 +15,21 @@ # specific language governing permissions and limitations # under the License. -name: "CodeQL" +name: "Continuous Integration" on: push: branches: - develop - paths-ignore: - - 'docs/**' pull_request: branches: - develop - paths-ignore: - - 'docs/**' - schedule: - - cron: '30 5 * * *' workflow_dispatch: jobs: - analyze: - name: Analyze + build: + name: Build + runs-on: ubuntu-latest strategy: @@ -49,11 +44,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: @@ -63,8 +53,16 @@ jobs: # queries: ./path/to/local/query, your-org/your-repo/queries@main languages: ${{ matrix.language }} + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Build - run: ./gradlew clean build + run: ./gradlew clean build jacocoTestReport - - name: Perform CodeQL Analysis + - name: Perform CodeQL analysis uses: github/codeql-action/analyze@v1 + + - name: Upload coverage report to codecov.io + run: bash <(curl -s https://codecov.io/bash) || echo 'Failed to upload coverage report!' diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index d0b85ebff7..8883906d2e 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -23,6 +23,7 @@ on: [pull_request, issues] jobs: greeting: + name: Greeting runs-on: ubuntu-latest steps: - uses: actions/first-interaction@v1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a6b1867585..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -dist: trusty - -language: java -jdk: - - oraclejdk8 - -script: - - travis_retry ./gradlew clean build - -#after_success: -# - ./gradlew clean - -env: - global: - - secure: "T1QAuaAzcB7K8YjAAVVb4P9+W0JAdOFbyBwRxliyyoSZUShlIqa0eE7ioXHXWBP/d5f3XtROse6lq2qILqcU9sFSncKE2vRJlwJ5p7R23WIsCXdV70A9AVE2gLJcIJiOTMwd/YYYzNDrGLp3CSJNcKo8t7t70V2j/11I9xPTOHnaZ8FHGC3d/7bjfR/+g/3d4EOCvV8Vm6ndEmmailmF8OJ/kcbuRbArKIehjUwNDyQZfwAc9+vvPZlHgnQvR1pJ/KiK6muEIi7RQohDq7lMTmcc2LZSYgy/+aqFrmBcQwXScABFmSwysQ4KMXfrCqqMsBdmvno/NoKVGofHHKdym/oauv/G3lxLx5sgM9A7ZSFBK08x08r7u/6TDsTFmQ9LzVFDNo/OLZhxs3dr9x2C9Pa2A7IP1i1oVbbYkwBJv4z6o3khWpQAAY/IWijlCZ9vkjFfqdIXbvlPqamEaFRAmK5I3MVqL2+eBF+2Or/zwv4rXjo+v5LUKTfmDl77QUshPv6J+hblbBR0cJ/ZTSh9rHgdqhEzPGSt3e0YrEefkKWfinBr8TjIsHgQgmfU8Kz7gf7tvioOuAgKj4WlgEQJs3dPp7J5zxFVNMM6teAMFy8c2MtAdzKrs13Ri1qZWtL6B7JWlH6yhHqhKghyJhRjUFNVZnBkA/z9gzDKZ+tz2m8=" \ No newline at end of file diff --git a/README.md b/README.md index c2926b6214..69d3e2a292 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Apache EventMesh (incubating) [![Build Status](https://www.travis-ci.org/apache/incubator-eventmesh.svg?branch=develop)](https://www.travis-ci.org/github/apache/incubator-eventmesh.svg?branch=develop) +[![CodeCov](https://codecov.io/gh/apache/incubator-eventmesh/branch/develop/graph/badge.svg)](https://codecov.io/gh/apache/incubator-eventmesh) [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/context:java) [![Total alerts](https://img.shields.io/lgtm/alerts/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/alerts/) [![GitHub release](https://img.shields.io/badge/release-download-orange.svg)](https://github.com/apache/incubator-eventmesh/releases) diff --git a/README.zh-CN.md b/README.zh-CN.md index ef688cc360..d863a47c81 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,5 +1,6 @@ # Apache EventMesh (Incubating) [![Build Status](https://www.travis-ci.org/apache/incubator-eventmesh.svg?branch=develop)](https://www.travis-ci.org/github/apache/incubator-eventmesh.svg?branch=develop) +[![CodeCov](https://codecov.io/gh/apache/incubator-eventmesh/branch/develop/graph/badge.svg)](https://codecov.io/gh/apache/incubator-eventmesh) [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/context:java) [![Total alerts](https://img.shields.io/lgtm/alerts/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/alerts/) [![GitHub release](https://img.shields.io/badge/release-download-orange.svg)](https://github.com/apache/incubator-eventmesh/releases) diff --git a/build.gradle b/build.gradle index e461728bd3..12a2b005e9 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,6 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } - } dependencies { @@ -63,7 +62,6 @@ allprojects { compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" - clean.doFirst { delete 'build' delete 'dist' @@ -73,7 +71,6 @@ allprojects { if ((project.findProperty("snapshot") instanceof String) && (Boolean.valueOf(project.property("snapshot")))) { version = version + "-SNAPSHOT" } - } task tar(type: Tar) { @@ -96,7 +93,6 @@ task zip(type: Zip) { } } - subprojects { List fastjson = [ @@ -142,7 +138,6 @@ subprojects { "com.lmax:disruptor:3.4.2" ] - List common = [ "commons-io:commons-io:2.4", "org.apache.commons:commons-text:1.9" @@ -165,7 +160,6 @@ subprojects { spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.7' } - sourceSets { main { java.srcDirs = ['src/main/java'] @@ -183,17 +177,13 @@ subprojects { jacoco { toolVersion = "0.8.6" - reportsDir = file("$buildDir/reports/jacoco") } jacocoTestReport { -// sourceSets sourceSets.main -// executionData files("$buildDir/jacoco/jacocoTest.exec") - reports { - xml.enabled false + xml.enabled true csv.enabled false - html.destination file("${buildDir}/reports/jacoco/html") + html.enabled false } } @@ -211,7 +201,7 @@ subprojects { // html.enabled true // } // } - +// // sourceSets { // main { // java { @@ -234,11 +224,8 @@ subprojects { // } // // } -// -// // } - spotbugs { //toolVersion = '4.2.3' ignoreFailures = true diff --git a/docs/README.md b/docs/README.md index 6761bc5ca8..65bcf0bef2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,6 @@ # Apache EventMesh (Incubating) [![Build Status](https://www.travis-ci.org/apache/incubator-eventmesh.svg?branch=develop)](https://www.travis-ci.org/github/apache/incubator-eventmesh.svg?branch=develop) +[![CodeCov](https://codecov.io/gh/apache/incubator-eventmesh/branch/develop/graph/badge.svg)](https://codecov.io/gh/apache/incubator-eventmesh) [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/context:java) [![Total alerts](https://img.shields.io/lgtm/alerts/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/alerts/) [![GitHub release](https://img.shields.io/badge/release-download-orange.svg)](https://github.com/apache/incubator-eventmesh/releases) diff --git a/docs/cn/README.md b/docs/cn/README.md index d7968edb9c..7b8f41f1d3 100644 --- a/docs/cn/README.md +++ b/docs/cn/README.md @@ -1,5 +1,6 @@ # Apache EventMesh (Incubating) [![Build Status](https://www.travis-ci.org/apache/incubator-eventmesh.svg?branch=develop)](https://www.travis-ci.org/github/apache/incubator-eventmesh.svg?branch=develop) +[![CodeCov](https://codecov.io/gh/apache/incubator-eventmesh/branch/develop/graph/badge.svg)](https://codecov.io/gh/apache/incubator-eventmesh) [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/context:java) [![Total alerts](https://img.shields.io/lgtm/alerts/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/alerts/) [![GitHub release](https://img.shields.io/badge/release-download-orange.svg)](https://github.com/apache/incubator-eventmesh/releases) diff --git a/docs/en/README.md b/docs/en/README.md index e09f292b7e..1125512e23 100644 --- a/docs/en/README.md +++ b/docs/en/README.md @@ -1,5 +1,6 @@ # Apache EventMesh (Incubating) [![Build Status](https://www.travis-ci.org/apache/incubator-eventmesh.svg?branch=develop)](https://www.travis-ci.org/github/apache/incubator-eventmesh.svg?branch=develop) +[![CodeCov](https://codecov.io/gh/apache/incubator-eventmesh/branch/develop/graph/badge.svg)](https://codecov.io/gh/apache/incubator-eventmesh) [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/context:java) [![Total alerts](https://img.shields.io/lgtm/alerts/g/apache/incubator-eventmesh.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-eventmesh/alerts/) [![GitHub release](https://img.shields.io/badge/release-download-orange.svg)](https://github.com/apache/incubator-eventmesh/releases)