Skip to content

Daily build

Daily build #482

Workflow file for this run

name: Daily build
# Controls when the action will run.
on:
schedule:
- cron: '30 2 * * *'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Build the ballerina project
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
pack ./teams
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
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
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
test --test-report --code-coverage --coverage-format=xml
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
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
# Send notification when build fails
- name: Notify failure
if: ${{ failure() }}
run: |
curl -X POST \
'https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches' \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: Bearer ${{ secrets.BALLERINA_BOT_TOKEN }}' \
--data "{
\"event_type\": \"notify-build-failure\",
\"client_payload\": {
\"repoName\": \"module-ballerinax-microsoft.teams\"
}
}"