Skip to content

Commit

Permalink
Merge pull request #239 from ThisaruGuruge/connector-revamp
Browse files Browse the repository at this point in the history
Move to Independent GraalVM Check Workflow
  • Loading branch information
ThisaruGuruge authored Mar 26, 2024
2 parents d636d31 + b14bd75 commit dcb920a
Showing 1 changed file with 57 additions and 6 deletions.
63 changes: 57 additions & 6 deletions .github/workflows/build-with-bal-test-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,65 @@ on:
schedule:
- cron: "30 18 * * *"
workflow_dispatch:
pull_request:
types: [opened, synchronize, labeled]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
group: graalvm-check
cancel-in-progress: true

jobs:
call_workflow_template:
name: Run Workflow Template
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-connector-template.yml@main
secrets: inherit
build:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'Skip GraalVM Check')

steps:
- name: Checkout the Repository
uses: actions/checkout@v3

- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: latest

- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: "17"
distribution: "graalvm-community"
set-java-home: true
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 ENV Variables
run: |
echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV
- name: Build Package
run: ./gradlew build
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}

- name: Remove Target Directory
run: sudo rm -rf ballerina/target

- name: Start MongoDB Server
run: |
cd ballerina/tests/resources/docker
docker-compose up -d
- name: Test with GraalVM
run: |
cd ballerina
bal test --graalvm
- name: Stop MongoDB Server
run: |
cd ballerina/tests/resources/docker
docker-compose down

0 comments on commit dcb920a

Please sign in to comment.