From 41286c8b5421070cfda3b2376cbc40730894181e Mon Sep 17 00:00:00 2001 From: salamafazlul Date: Mon, 10 Jun 2024 09:02:11 +0530 Subject: [PATCH] Add daily build workflow --- .github/workflows/daily-build.yml | 42 +++++++++++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/daily-build.yml diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml new file mode 100644 index 0000000..b8104f6 --- /dev/null +++ b/.github/workflows/daily-build.yml @@ -0,0 +1,42 @@ +# This workflow runs daily to build Ballerina projects. +name: Daily build + +on: + schedule: + - cron: '30 20 * * *' # 02:00 AM in LK time (GMT+5:30) + workflow_dispatch: + +env: + BALLERINA_VERSION: 2201.9.0 + +jobs: + build: + name: Build Ballerina Projects + runs-on: ubuntu-latest + env: + JAVA_OPTS: -Xmx4G + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set Up Ballerina + uses: ballerina-platform/setup-ballerina@v1.1.0 + with: + version: $BALLERINA_VERSION + + - name: Build Ballerina Projects + run: | + # Find Ballerina Project Folders + BALLERINA_PROJECT_FOLDERS=$(find . -name "Ballerina.toml" -printf '%p\n' | sed 's/\/Ballerina.toml$//' | sort -u | tr '\n' ' ') + + # Convert BALLERINA_PROJECT_FOLDERS to an array + read -r -a BALLERINA_PROJECTS <<<"${BALLERINA_PROJECT_FOLDERS}" + + # Build With Ballerina + for folder in "${BALLERINA_PROJECTS[@]}"; do + pushd "$folder" + bal build + popd + done + \ No newline at end of file diff --git a/README.md b/README.md index 266efce..2702843 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # healthcare-samples + +![Daily Build](https://github.com/ballerina-guides/healthcare-samples/actions/workflows/daily-build.yml/badge.svg) + This repository contains a collection of healthcare-related samples written in Ballerina. ## how to build?