diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..a8a331d9 --- /dev/null +++ b/.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 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}} 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 } }