Restrict CI workflow runs to specific branches #206
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: Pull Request | |
on: [ pull_request ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Setup Ballerina Environment | |
- name: Set Up Ballerina | |
uses: ballerina-platform/[email protected] | |
with: | |
version: latest | |
# Build Ballerina Project | |
- name: Ballerina Build | |
run: bal pack ./ballerina | |
env: | |
JAVA_HOME: /usr/lib/jvm/default-jvm | |
# Build Module Examples | |
- name: Ballerina Examples Build | |
run: chmod +x ./examples/build.sh && ./examples/build.sh build | |
env: | |
JAVA_HOME: /usr/lib/jvm/default-jvm | |
# Test Ballerina Project | |
- name: Ballerina Test | |
working-directory: ./ballerina | |
# 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: | |
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} | |
SLACK_USERNAME: ${{ secrets.SLACK_USERNAME }} | |
JAVA_HOME: /usr/lib/jvm/default-jvm | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 |