-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from nipunayf/build-examples
Build and test the examples
- Loading branch information
Showing
48 changed files
with
339 additions
and
207 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
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/setup-ballerina@v1.1.0 | ||
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 | ||
working-directory: ./excel | ||
run: bal test --graalvm | ||
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 }} | ||
WORKBOOK_PATH: ${{ secrets.WORKBOOK_PATH }} | ||
- 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/setup-ballerina@v1.1.0 | ||
with: | ||
version: latest | ||
|
||
- name: Run Ballerina tests using the native executable | ||
working-directory: ./ballerina | ||
run: bal test --graalvm | ||
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 }} | ||
WORKBOOK_PATH: ${{ secrets.WORKBOOK_PATH }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,59 @@ | ||
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 | ||
env: | ||
WORKING_DIR: ./excel | ||
JAVA_HOME: /usr/lib/jvm/default-jvm | ||
|
||
# Test the ballerina project | ||
- name: Ballerina Test | ||
uses: ballerina-platform/ballerina-action/@nightly | ||
with: | ||
args: | ||
test --code-coverage | ||
env: | ||
WORKING_DIR: ./excel | ||
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 }} | ||
WORKBOOK_PATH: ${{ secrets.WORKBOOK_PATH }} | ||
|
||
# Read the ballerina test results | ||
- name: Read Ballerina Test Results | ||
id: test_results | ||
run: | | ||
content=`cat ./excel/target/report/test_results.json` | ||
content="${content//'%'/'%25'}" | ||
content="${content//$'\n'/'%0A'}" | ||
content="${content//$'\r'/'%0D'}" | ||
echo "::set-output name=testResultsJson::$content" | ||
# Print the code coverage information | ||
- name: Code Coverage | ||
run: | | ||
echo "Covered Code Lines : ${{fromJson(steps.test_results.outputs.testResultsJson).coveredLines}}" | ||
echo "Total Code Lines : $(expr ${{fromJson(steps.test_results.outputs.testResultsJson).missedLines}} + ${{fromJson(steps.test_results.outputs.testResultsJson).coveredLines}})" | ||
echo "Code Coverage Percentage : ${{fromJson(steps.test_results.outputs.testResultsJson).coveragePercentage}}" | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Setup Ballerina Environment | ||
- name: Set Up Ballerina | ||
uses: ballerina-platform/setup-ballerina@v1.1.0 | ||
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: | ||
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 }} | ||
WORKBOOK_PATH: ${{ secrets.WORKBOOK_PATH }} | ||
|
||
- 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.excel\" | ||
} | ||
}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,56 @@ | ||
name: Dev/Staging BCentral Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
bal_central_environment: | ||
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 | ||
release: | ||
runs-on: ubuntu-latest | ||
env: | ||
BALLERINA_${{ github.event.inputs.bal_central_environment }}_CENTRAL: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Setup Ballerina Environment | ||
- name: Set Up Ballerina | ||
uses: ballerina-platform/setup-ballerina@v1.1.0 | ||
with: | ||
version: 2201.2.1 | ||
|
||
# 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 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Ballerina Build | ||
uses: ballerina-platform/ballerina-action/@2201.2.1 | ||
with: | ||
args: | ||
pack | ||
env: | ||
WORKING_DIR: ./excel | ||
# 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 | ||
|
||
- name: Push to Staging | ||
uses: ballerina-platform/ballerina-action/@2201.2.1 | ||
if: github.event.inputs.bal_central_environment == 'STAGE' | ||
with: | ||
args: | ||
push | ||
env: | ||
WORKING_DIR: ./excel | ||
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }} | ||
- name: Push to Dev | ||
uses: ballerina-platform/ballerina-action/@2201.2.1 | ||
if: github.event.inputs.bal_central_environment == 'DEV' | ||
with: | ||
args: | ||
push | ||
env: | ||
WORKING_DIR: ./excel | ||
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }} | ||
# 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 |
Oops, something went wrong.