From 35ef44989c1d5745cbd10de4c4246edafcef57e9 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/gitee-mirror.yml | 2 +- .github/workflows/greetings.yml | 1 + build.gradle | 19 ++---------- 5 files changed, 19 insertions(+), 34 deletions(-) delete mode 100644 .coveralls.yml rename .github/workflows/{codeql-analysis.yml => ci.yml} (85%) 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/gitee-mirror.yml b/.github/workflows/gitee-mirror.yml index b29e0806f6..a95fceffcb 100644 --- a/.github/workflows/gitee-mirror.yml +++ b/.github/workflows/gitee-mirror.yml @@ -57,4 +57,4 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.EVENTMESH }} BRANCH: gh-pages - FOLDER: docs/.vuepress/dist # The folder the action should deploy. + FOLDER: docs/.vuepress/dist # The folder the action should deploy. \ No newline at end of file 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/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