From 5c5b43b5695ebf4af755d5915b668c94af787a81 Mon Sep 17 00:00:00 2001 From: saimedhi Date: Fri, 27 Sep 2024 09:43:35 -0700 Subject: [PATCH] Add Codecov for test coverage reporting Signed-off-by: saimedhi --- .github/workflows/build-and-test.yml | 8 ++++++++ codecov.yml | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index aba2c515..7117825c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -45,6 +45,10 @@ jobs: su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v && cd ./plugins/dashboards-flow-framework && whoami && yarn osd bootstrap && yarn build && yarn run test:jest --coverage" + - name: Uploads coverage + uses: codecov/codecov-action@v2 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # TODO: once github actions supports windows and macos docker containers, we can # merge these in to the above step's matrix, including adding windows support @@ -96,4 +100,8 @@ jobs: run: | cd OpenSearch-Dashboards/plugins/dashboards-flow-framework yarn run test:jest --coverage + - name: Uploads coverage + uses: codecov/codecov-action@v2 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/codecov.yml b/codecov.yml index 44df4e8e..34b11db4 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,11 +1,9 @@ -# disable tracking status entirely until UT is added. -# tracking issue: https://github.com/opensearch-project/dashboards-flow-framework/issues/95 coverage: # displays different colors depending on below, between, or above the range range: 50..90 status: project: - enabled: no + enabled: yes default: target: auto # allows 5% coverage reduction without failing @@ -14,4 +12,4 @@ coverage: changes: no # disable comments in PRs -comment: no \ No newline at end of file +comment: yes \ No newline at end of file