-
Notifications
You must be signed in to change notification settings - Fork 44
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 #323 from ballerina-platform/revamp-2023
Migrate Build workflow to central one
- Loading branch information
Showing
1 changed file
with
10 additions
and
69 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,78 +1,19 @@ | ||
name: CI | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- 2201.[0-9]+.x | ||
repository_dispatch: | ||
types: | ||
check_connector_for_breaking_changes | ||
types: check_connector_for_breaking_changes | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Set up Java Environment | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 17.0.7 | ||
|
||
# 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: | ||
CLIENT_ID: ${{ secrets.CLIENT_ID }} | ||
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | ||
EP_URL: ${{ secrets.EP_URL }} | ||
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} | ||
REFRESH_URL: ${{ secrets.REFRESH_URL }} | ||
JAVA_HOME: /usr/lib/jvm/default-jvm | ||
|
||
- 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-sfdc", | ||
"workflow": "CI" | ||
} | ||
}' | ||
call_workflow: | ||
name: Run Connector Build Workflow | ||
if: ${{ github.repository_owner == 'ballerina-platform' }} | ||
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-connector-template.yml@main | ||
secrets: inherit | ||
with: | ||
repo-name: module-ballerinax-sfdc | ||
|