-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update build scripts #794
Closed
Closed
Update build scripts #794
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,39 +1,39 @@ | ||
name: GraalVM Check | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
lang_tag: | ||
description: Branch/Release Tag of the Ballerina Lang | ||
required: true | ||
default: master | ||
lang_version: | ||
description: Ballerina Lang Version (If given ballerina lang buid will be skipped) | ||
required: false | ||
default: '' | ||
native_image_options: | ||
description: Default native-image options | ||
required: false | ||
default: '' | ||
schedule: | ||
- cron: '30 18 * * *' | ||
pull_request: | ||
branches: | ||
- master | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
workflow_dispatch: | ||
inputs: | ||
lang_tag: | ||
description: Branch/Release Tag of the Ballerina Lang | ||
required: true | ||
default: master | ||
lang_version: | ||
description: Ballerina Lang Version (If given ballerina lang buid will be skipped) | ||
required: false | ||
default: '' | ||
native_image_options: | ||
description: Default native-image options | ||
required: false | ||
default: '' | ||
schedule: | ||
- cron: '30 18 * * *' | ||
pull_request: | ||
branches: | ||
- master | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | ||
cancel-in-progress: true | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
call_stdlib_workflow: | ||
name: Run StdLib Workflow | ||
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} | ||
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main | ||
with: | ||
lang_tag: ${{ inputs.lang_tag }} | ||
lang_version: ${{ inputs.lang_version }} | ||
native_image_options: ${{ inputs.native_image_options }} | ||
additional_ubuntu_build_flags: '-x :nats-compiler-plugin-tests:test' | ||
additional_windows_build_flags: '-x test' | ||
call_stdlib_workflow: | ||
name: Run StdLib Workflow | ||
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} | ||
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main | ||
with: | ||
lang_tag: ${{ inputs.lang_tag }} | ||
lang_version: ${{ inputs.lang_version }} | ||
native_image_options: '-J-Xmx7G ${{ inputs.native_image_options }}' | ||
additional_ubuntu_build_flags: '-x :nats-compiler-plugin-tests:test' | ||
additional_windows_build_flags: '-x test' |
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 |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Build with Ballerina Lang | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
lang_tag: | ||
description: Branch/Release Tag of the Ballerina Lang | ||
required: false | ||
default: master | ||
lang_version: | ||
description: Ballerina Lang Version (If given ballerina lang buid will be skipped) | ||
required: false | ||
default: '' | ||
build_properties: | ||
description: Additional build properties | ||
required: false | ||
default: '' | ||
|
||
jobs: | ||
ubuntu-build-with-bal-test-native: | ||
name: Build with Ballerina Lang on Ubuntu | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 90 | ||
|
||
steps: | ||
- name: Checkout Ballerina Lang Repository | ||
if: ${{ inputs.lang_version == '' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'ballerina-platform/ballerina-lang' | ||
ref: ${{ inputs.lang_tag || 'master' }} | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17.0.7 | ||
|
||
- name: Set Ballerina Lang version | ||
run: | | ||
if ${{ inputs.lang_version != ''}}; then | ||
LANG_VERSION=${{ inputs.lang_version }} | ||
else | ||
VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev) | ||
LANG_VERSION=$VERSION-NATIVE | ||
fi | ||
echo "BALLERINA_LANG_VERSION=$LANG_VERSION" >> $GITHUB_ENV | ||
echo "BALLERINA_LANG_VERSION: $LANG_VERSION" | ||
|
||
- name: Build Ballerina Lang | ||
if: ${{ inputs.lang_version == '' }} | ||
run: | | ||
perl -pi -e "s/^\s*version=.*/version=${{ env.BALLERINA_LANG_VERSION }}/" gradle.properties | ||
./gradlew build -x check -x test publishToMavenLocal --scan --no-daemon | ||
|
||
- name: Checkout Module Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build Module | ||
env: | ||
packageUser: ${{ github.actor }} | ||
packagePAT: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
perl -pi -e "s/^\s*ballerinaLangVersion=.*/ballerinaLangVersion=${{ env.BALLERINA_LANG_VERSION }}/" gradle.properties | ||
./gradlew build ${{ inputs.build_properties }} | ||
|
||
windows-build-with-bal-test-native: | ||
name: Build with Ballerina Lang on Windows | ||
runs-on: windows-latest | ||
timeout-minutes: 90 | ||
|
||
steps: | ||
- name: Checkout Ballerina Lang Repository | ||
if: ${{ inputs.lang_version == '' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'ballerina-platform/ballerina-lang' | ||
ref: ${{ inputs.lang_tag || 'master' }} | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17.0.7 | ||
|
||
- name: Set Ballerina Lang version | ||
run: | | ||
if ("${{ inputs.lang_version }}" -eq "") { | ||
$properties = convertfrom-stringdata (get-content ./gradle.properties -raw) | ||
$LANG_VERSION = $properties.'version'.split("-",2)[0] + "-NATIVE" | ||
} else { | ||
$LANG_VERSION = "${{ inputs.lang_version }}" | ||
} | ||
"BALLERINA_LANG_VERSION=$LANG_VERSION" >> $env:GITHUB_ENV | ||
Write-Output "BALLERINA_LANG_VERSION: $LANG_VERSION" | ||
|
||
- name: Configure Pagefile | ||
uses: al-cheb/configure-pagefile-action@v1.3 | ||
with: | ||
minimum-size: 10GB | ||
maximum-size: 16GB | ||
|
||
- name: Get configured pagefile base size | ||
run: (Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize | ||
|
||
- name: Build Ballerina Lang | ||
if: ${{ inputs.lang_version == '' }} | ||
run: | | ||
perl -pi -e "s/^\s*version=.*/version=${{ env.BALLERINA_LANG_VERSION }}/" gradle.properties | ||
./gradlew.bat build -x check -x test publishToMavenLocal --continue -x createJavadoc --stacktrace -scan --console=plain --no-daemon --no-parallel | ||
|
||
- name: Checkout Module Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build Module | ||
env: | ||
packageUser: ${{ github.actor }} | ||
packagePAT: ${{ secrets.GITHUB_TOKEN }} | ||
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 | ||
run: | | ||
perl -pi -e "s/^\s*ballerinaLangVersion=.*/ballerinaLangVersion=${{ env.BALLERINA_LANG_VERSION }}/" gradle.properties | ||
./gradlew.bat build ${{ inputs.build_properties }} -x test |
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 |
---|---|---|
|
@@ -17,12 +17,12 @@ jobs: | |
with: | ||
distribution: 'temurin' | ||
java-version: 17.0.7 | ||
|
||
- name: Set environment variable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is workflow is not centralized. Is this because this module has compiler plugin? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
if: github.event.action == 'check_connector_for_breaking_changes' | ||
run: | | ||
echo "BUILD_USING_DOCKER=-PbuildUsingDocker=nightly" >> $GITHUB_ENV | ||
echo "GRADLE_SKIP_TASKS=-x :nats-compiler-plugin-tests:test -x :nats-ballerina-tests:build -x :nats-ballerina-tests:test" >> $GITHUB_ENV | ||
echo "GRADLE_SKIP_TASKS=-x :nats-compiler-plugin-tests:test" >> $GITHUB_ENV | ||
|
||
# Build the project with Gradle | ||
- name: Build with Gradle | ||
|
@@ -32,6 +32,7 @@ jobs: | |
run: | | ||
./gradlew clean build $GRADLE_SKIP_TASKS $BUILD_USING_DOCKER | ||
|
||
# Send notification when build fails | ||
- name: Notify failure | ||
if: ${{ failure() }} | ||
run: | | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this workflow? Does the other ballerinax connectors have this workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got these workflows from the
ballerinax/kafka
connector, since these have the compiler plugin I was asked to add the standard library workflows. https://github.com/ballerina-platform/module-ballerinax-kafka/blob/master/.github/workflows/build-with-ballerina-lang.yml