diff --git a/.github/workflows/dashboards-reports-test-and-build-workflow.yml b/.github/workflows/dashboards-reports-test-and-build-workflow.yml index 1fc6eaa9..fe51bf88 100644 --- a/.github/workflows/dashboards-reports-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-reports-test-and-build-workflow.yml @@ -49,7 +49,14 @@ jobs: with: timeout_minutes: 30 max_attempts: 3 - command: cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn test + command: cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn test --coverage + + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + flags: dashboards-reports + directory: OpenSearch-Dashboards/plugins/ + token: ${{ secrets.CODECOV_TOKEN }} - name: Build Artifact run: | diff --git a/.github/workflows/reports-scheduler-test-and-build-workflow.yml b/.github/workflows/reports-scheduler-test-and-build-workflow.yml index 28b088f5..1785064c 100644 --- a/.github/workflows/reports-scheduler-test-and-build-workflow.yml +++ b/.github/workflows/reports-scheduler-test-and-build-workflow.yml @@ -2,6 +2,7 @@ name: Test and Build Reports Scheduler on: [push, pull_request] + jobs: build: runs-on: ubuntu-latest @@ -54,6 +55,13 @@ jobs: cd reports-scheduler ./gradlew build -Dopensearch.version=1.0.0-rc1 + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + flags: reports-scheduler + directory: reports-scheduler/ + token: ${{ secrets.CODECOV_TOKEN }} + - name: Create Artifact Path run: | mkdir -p reports-scheduler-builds diff --git a/reports-scheduler/.codecov.yml b/reports-scheduler/.codecov.yml new file mode 100644 index 00000000..84e02daa --- /dev/null +++ b/reports-scheduler/.codecov.yml @@ -0,0 +1,39 @@ +## +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. +## + +## +# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# or in the "license" file accompanying this file. This file 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 + +coverage: + precision: 2 + round: down + range: "70...100" + status: + project: + default: + target: 70% # the required coverage value + threshold: 1% # the leniency in hitting the target \ No newline at end of file