Skip to content

Generate code coverage reports using CodeCov #75

Generate code coverage reports using CodeCov

Generate code coverage reports using CodeCov #75

Workflow file for this run

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