Skip to content

Commit

Permalink
Merge pull request #280 from nipunayf/build-examples
Browse files Browse the repository at this point in the history
Build and test the examples
  • Loading branch information
NipunaRanasinghe authored Aug 29, 2023
2 parents a8fb1b8 + 5da1818 commit 7f7ea6f
Show file tree
Hide file tree
Showing 53 changed files with 315 additions and 226 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/build-with-bal-test-native.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: GraalVM Check

on:
on:
schedule:
- cron: '30 18 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
steps:
- uses: actions/checkout@v2

- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check GraalVM installation
run: |
echo "GRAALVM_HOME: ${{ env.GRAALVM_HOME }}"
echo "JAVA_HOME: ${{ env.JAVA_HOME }}"
native-image --version
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: latest
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Ballerina tests using the native executable
run: bal test --graalvm ./gsheet
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
- name: Check GraalVM installation
run: |
echo "GRAALVM_HOME: ${{ env.GRAALVM_HOME }}"
echo "JAVA_HOME: ${{ env.JAVA_HOME }}"
native-image --version
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: latest

- name: Run Ballerina tests using the native executable
run: bal test --graalvm ./ballerina
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
98 changes: 50 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: CI

# Controls when the action will run.
# Triggers the workflow on push.
on:
push:
branches-ignore:
Expand All @@ -11,50 +9,54 @@ on:
types:
check_connector_for_breaking_changes

# 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 ./gsheet

# Test the ballerina project
- name: Ballerina Tests
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
test --test-report --code-coverage --coverage-format=xml ./gsheet
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

- name: Alert notifier on failure
if: failure() && (github.event.action == 'check_connector_for_breaking_changes')
run: |
curl -X POST \
'https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches' \
--header 'Accept: application/vnd.github.v3+json' \
--header 'Authorization: Bearer ${{ secrets.BALLERINA_BOT_TOKEN }}' \
--data-raw '{
"event_type": "notify-ballerinax-connector-build-failure",
"client_payload": {
"repoName": "module-ballerinax-googleapis.sheets",
"workflow": "CI"
}
}'
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
run: bal test ./ballerina --test-report --code-coverage --coverage-format=xml
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

# Send notification when build fails
- name: Alert notifier on failure
if: failure() && (github.event.action == 'check_connector_for_breaking_changes')
run: |
curl -X POST \
'https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches' \
--header 'Accept: application/vnd.github.v3+json' \
--header 'Authorization: Bearer ${{ secrets.BALLERINA_BOT_TOKEN }}' \
--data-raw '{
"event_type": "notify-ballerinax-connector-build-failure",
"client_payload": {
"repoName": "module-ballerinax-googleapis.sheets",
"workflow": "CI"
}
}'
99 changes: 51 additions & 48 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,57 @@
name: Daily build

# Controls when the action will run.
on:
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 ./gsheet

# Test the ballerina project
- name: Ballerina Tests
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
test --test-report --code-coverage --coverage-format=xml ./gsheet
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}

- 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-googleapis.sheets\"
}
}"
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
run: bal test --test-report --code-coverage --coverage-format=xml ./ballerina
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm

- 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-googleapis.sheets\"
}
}"
73 changes: 37 additions & 36 deletions .github/workflows/dev-stg-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,44 @@ on:
description: Ballerina Central Environment
type: choice
options:
- STAGE
- DEV
- STAGE
- DEV
required: true

jobs:
release:
runs-on: ubuntu-latest
env:
BALLERINA_${{ github.event.inputs.bal_central_environment }}_CENTRAL: true
steps:
- uses: actions/checkout@v2

# Build the ballerina project
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@2201.2.1
with:
args:
pack ./gsheet
release:
runs-on: ubuntu-latest
env:
BALLERINA_${{ github.event.inputs.bal_central_environment }}_CENTRAL: true
steps:
- uses: actions/checkout@v2

# Push the package to Ballerina central - Staging
- name: Push to Staging
if: github.event.inputs.bal_central_environment == 'STAGE'
uses: ballerina-platform/ballerina-action/@2201.2.1
with:
args:
push
env:
WORKING_DIR: ./gsheet
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }}

# Push the package to Ballerina central - Dev
- name: Push to Dev
if: github.event.inputs.bal_central_environment == 'DEV'
uses: ballerina-platform/ballerina-action/@2201.2.1
with:
args:
push
env:
WORKING_DIR: ./gsheet
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}
# Setup Ballerina Environment
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: 2201.2.1

# Build Ballerina Project
- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm

# Push to Ballerina Staging Central
- name: Push to Staging
if: github.event.inputs.bal_central_environment == 'STAGE'
run: bal push
working-directory: ./ballerina
env:
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm

# Push to Ballerina Dev Central
- name: Push to Dev
if: github.event.inputs.bal_central_environment == 'DEV'
run: bal push
working-directory: ./ballerina
env:
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
Loading

0 comments on commit 7f7ea6f

Please sign in to comment.