Skip to content

Commit

Permalink
Generate code coverage reports using CodeCov
Browse files Browse the repository at this point in the history
  • Loading branch information
heshanpadmasiri committed Jul 20, 2023
1 parent 6104f2d commit c643f98
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ jobs:
USER_ID_1: ${{ secrets.USER_ID_1 }}
USER_ID_2: ${{ secrets.USER_ID_2 }}
USER_ID_3: ${{ secrets.USER_ID_3 }}
- name: Ballerina Tests
run: bal test --test-report --code-coverage --coverage-format=xml
env:
WORKING_DIR: ./teams
REFRESH_URL: ${{ secrets.REFRESH_URL }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
USER_ID_1: ${{ secrets.USER_ID_1 }}
USER_ID_2: ${{ secrets.USER_ID_2 }}
USER_ID_3: ${{ secrets.USER_ID_3 }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3:wa

- name: Alert notifier on failure
if: failure() && (github.event.action == 'check_connector_for_breaking_changes')
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ jobs:
USER_ID_2: ${{ secrets.USER_ID_2 }}
USER_ID_3: ${{ secrets.USER_ID_3 }}

- name: Ballerina Tests
run: bal test --test-report --code-coverage --coverage-format=xml
env:
WORKING_DIR: ./teams
REFRESH_URL: ${{ secrets.REFRESH_URL }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
USER_ID_1: ${{ secrets.USER_ID_1 }}
USER_ID_2: ${{ secrets.USER_ID_2 }}
USER_ID_3: ${{ secrets.USER_ID_3 }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3:wa

# Send notification when build fails
- name: Notify failure
if: ${{ failure() }}
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,20 @@ jobs:
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
USER_ID_1: ${{ secrets.USER_ID_1 }}
USER_ID_2: ${{ secrets.USER_ID_2 }}
USER_ID_3: ${{ secrets.USER_ID_3 }}
USER_ID_3: ${{ secrets.USER_ID_3 }}
- name: Ballerina Tests
# tests will be skipped if the PR is from a forked repository (as the secrets are not available)
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
run: bal test --test-report --code-coverage --coverage-format=xml
env:
WORKING_DIR: ./teams
REFRESH_URL: ${{ secrets.REFRESH_URL }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
USER_ID_1: ${{ secrets.USER_ID_1 }}
USER_ID_2: ${{ secrets.USER_ID_2 }}
USER_ID_3: ${{ secrets.USER_ID_3 }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3:wa
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Ballerina Microsoft Teams Connector
===================
[![Build Status](https://github.com/ballerina-platform/module-ballerinax-microsoft.teams/workflows/CI/badge.svg)](https://github.com/ballerina-platform/module-ballerinax-msgraph-teams/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/ballerina-platform/module-ballerinax-microsoft.teams/branch/main/graph/badge.svg)](https://codecov.io/gh/ballerina-platform/module-ballerinax-microsoft.teams)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/ballerina-platform/module-ballerinax-microsoft.teams.svg)](https://github.com/ballerina-platform/module-ballerinax-msgraph-teams/commits/master)
[![GraalVM Check](https://github.com/ballerina-platform/module-ballerinax-microsoft.teams/actions/workflows/build-with-bal-test-native.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerinax-microsoft.teams/actions/workflows/build-with-bal-test-native.yml)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
Expand Down

0 comments on commit c643f98

Please sign in to comment.