Generate code coverage reports using CodeCov #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI_pull_request | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Ballerina Build | |
uses: ballerina-platform/ballerina-action/@nightly | |
with: | |
args: | |
pack ./teams | |
env: | |
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: 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 ./teams | |
env: | |
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 |