Skip to content

Daily build

Daily build #49

Workflow file for this run

# 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.8.5
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: |
# Define folders to skip building
SKIP_FOLDERS=( "working-with-health-tool" )
# Find Ballerina Project Folders
BALLERINA_PROJECT_FOLDERS=$(find . -name "Ballerina.toml" -printf '%p\n' | sed 's/\/Ballerina.toml$//' | sed 's,^./,,' | 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
if [[ ! "$folder" =~ ^(${SKIP_FOLDERS[@]//\//|}) ]]; then
pushd "$folder"
bal build
popd
fi
done