From 87a64c9f0d47426e0d463f7df3c86be88fc8d64e Mon Sep 17 00:00:00 2001 From: Amit-Singh40 Date: Thu, 22 Feb 2024 13:30:23 +0530 Subject: [PATCH 1/5] changes for codecov Signed-off-by: Amit-Singh40 --- .github/workflows/build.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 81360519..22590b82 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -97,3 +97,22 @@ jobs: - name: Upload to Codecov uses: codecov/codecov-action@v1 + snapshot: + name: Publish snapshot packages + needs: [ build_and_test_complete ] + # Only run this on PUSH (no pull requests) and only on the master branch and release branches. + if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/r0.') || startsWith(github.ref, 'refs/heads/r1.')) }} + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '11' + - name: Assemble + run: ./gradlew assemble --parallel ${{env.GRADLE_OPTS}} + - name: Publish to GitHub Packages + run: ./gradlew publish -PpublishUrl=https://maven.pkg.github.com/${{github.repository}} -PpublishUsername=${{github.actor}} -PpublishPassword=${{secrets.GITHUB_TOKEN}} ${{env.GRADLE_OPTS}} From 3d5449b88336f21639aec132cf5e462fbd0c0270 Mon Sep 17 00:00:00 2001 From: Amit-Singh40 Date: Thu, 22 Feb 2024 13:47:41 +0530 Subject: [PATCH 2/5] Adding codecov.yml Signed-off-by: Amit-Singh40 --- pravega-sensor-collector/.codecov.yml | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pravega-sensor-collector/.codecov.yml diff --git a/pravega-sensor-collector/.codecov.yml b/pravega-sensor-collector/.codecov.yml new file mode 100644 index 00000000..a8a331d9 --- /dev/null +++ b/pravega-sensor-collector/.codecov.yml @@ -0,0 +1,33 @@ +# +# Copyright Pravega Authors. +# +# Licensed 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 + max_report_age: off + notify: + wait_for_ci: yes + +coverage: + status: + project: + default: + threshold: 0.5% + patch: + default: + target: 80% + ignore: + - "**/generated/**" + - "standalone" + - "test" \ No newline at end of file From ef20462ef62869b42eefa39e447209406b1a691e Mon Sep 17 00:00:00 2001 From: Amit-Singh40 Date: Thu, 22 Feb 2024 13:57:41 +0530 Subject: [PATCH 3/5] Adding codecov.yml Signed-off-by: Amit-Singh40 --- pravega-sensor-collector/.codecov.yml => .codecov.yml | 0 pravega-sensor-collector/build.gradle | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename pravega-sensor-collector/.codecov.yml => .codecov.yml (100%) diff --git a/pravega-sensor-collector/.codecov.yml b/.codecov.yml similarity index 100% rename from pravega-sensor-collector/.codecov.yml rename to .codecov.yml diff --git a/pravega-sensor-collector/build.gradle b/pravega-sensor-collector/build.gradle index 4e089677..d3d2d39a 100644 --- a/pravega-sensor-collector/build.gradle +++ b/pravega-sensor-collector/build.gradle @@ -133,7 +133,7 @@ tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { spotbugs { toolVersion = spotbugsVersion - ignoreFailures = true + ignoreFailures = false showProgress = true effort = 'max' reportLevel = 'default' @@ -144,7 +144,7 @@ spotbugs { checkstyle { toolVersion = checkstyleVersion configFile = file("$rootDir/config/checkstyle.xml") - ignoreFailures = true + ignoreFailures = false configProperties = [importControlFile: "$rootDir/config/import-control.xml", suppressionsFile: "$rootDir/config/suppressions.xml"] checkstyleMain { From b26f944a08e73c4dffc87d3ce81d3e4475048026 Mon Sep 17 00:00:00 2001 From: Amit-Singh40 Date: Thu, 22 Feb 2024 14:01:19 +0530 Subject: [PATCH 4/5] Adding codecov.yml Signed-off-by: Amit-Singh40 --- pravega-sensor-collector/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pravega-sensor-collector/build.gradle b/pravega-sensor-collector/build.gradle index d3d2d39a..4e089677 100644 --- a/pravega-sensor-collector/build.gradle +++ b/pravega-sensor-collector/build.gradle @@ -133,7 +133,7 @@ tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { spotbugs { toolVersion = spotbugsVersion - ignoreFailures = false + ignoreFailures = true showProgress = true effort = 'max' reportLevel = 'default' @@ -144,7 +144,7 @@ spotbugs { checkstyle { toolVersion = checkstyleVersion configFile = file("$rootDir/config/checkstyle.xml") - ignoreFailures = false + ignoreFailures = true configProperties = [importControlFile: "$rootDir/config/import-control.xml", suppressionsFile: "$rootDir/config/suppressions.xml"] checkstyleMain { From ec17bfaefd4b502e0c79e3c056092dca5f3d9ce6 Mon Sep 17 00:00:00 2001 From: Amit-Singh40 Date: Thu, 22 Feb 2024 14:16:59 +0530 Subject: [PATCH 5/5] changes for codecov reports Signed-off-by: Amit-Singh40 --- pravega-sensor-collector/build.gradle | 30 ++++++++++----------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/pravega-sensor-collector/build.gradle b/pravega-sensor-collector/build.gradle index 4e089677..1a23a81f 100644 --- a/pravega-sensor-collector/build.gradle +++ b/pravega-sensor-collector/build.gradle @@ -161,24 +161,16 @@ checkstyle { } } - -test { - finalizedBy jacocoTestReport // report is always generated after tests run -} - -jacocoTestReport { - dependsOn test // tests are required to run before generating the report -} - -jacoco { - toolVersion = "0.8.9" - reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir') -} - -jacocoTestReport { - reports { - xml.required = false - csv.required = false - html.outputLocation = layout.buildDirectory.dir('jacocoHtml') +plugins.withId('jacoco') { + jacoco { + toolVersion = "0.8.5" } + jacocoTestReport { + reports { + xml.enabled true + html.enabled false + } + } + + test { finalizedBy jacocoTestReport } }