Daily build #849
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: Daily build | |
on: | |
schedule: | |
- cron: '30 2 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Set up Java Environment | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
# Setup Ballerina Environment | |
- name: Set Up Ballerina | |
uses: ballerina-platform/[email protected] | |
with: | |
version: latest | |
# Grant execute permission to the gradlew script | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
# Build the project with Gradle | |
- name: Build with Gradle | |
env: | |
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | |
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | |
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true | |
run: | | |
./gradlew build -x test | |
# Build Ballerina Project | |
- name: Ballerina Build | |
run: bal pack ./ballerina | |
env: | |
JAVA_HOME: /usr/lib/jvm/default-jvm | |
# Test Ballerina Project | |
- name: Ballerina Test | |
run: bal test --test-report --code-coverage --coverage-format=xml ./ballerina | |
env: | |
JAVA_HOME: /usr/lib/jvm/default-jvm | |
CONNECTION_STRING: ${{ secrets.CONNECTION_STRING }} | |
QUEUE_NAME: ${{ secrets.QUEUE_NAME }} | |
TOPIC_NAME: ${{ secrets.TOPIC_NAME }} | |
SUBSCRIPTION_NAME1: ${{ secrets.SUBSCRIPTION_NAME1 }} | |
SUBSCRIPTION_NAME2: ${{ secrets.SUBSCRIPTION_NAME2 }} | |
SUBSCRIPTION_NAME3: ${{ secrets.SUBSCRIPTION_NAME3 }} | |
- 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-azure-service-bus\" | |
} | |
}" |