From 8412e27a318c1f8779144cf323a17d4bb3a2e9c2 Mon Sep 17 00:00:00 2001 From: KavinduZoysa Date: Sat, 15 Jun 2024 10:15:48 +0530 Subject: [PATCH] Add pull request action --- .github/workflows/pull-request.yml | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..f817c42 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,47 @@ +name: PR Build + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + +on: pull_request + +jobs: + ubuntu-build: + name: Build + runs-on: ubuntu-latest + concurrency: + group: ${{ github.head_ref }}-ubuntu-build + cancel-in-progress: true + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set Up Ballerina + uses: ballerina-platform/setup-ballerina@v1.1.0 + with: + version: latest + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17.0.7 + + - name: Set ENV Variables + run: | + echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build the Package + env: + packageUser: ${{ github.actor }} + packagePAT: ${{ secrets.GITHUB_TOKEN }} + run: | + ./gradlew clean -x test -x check :mi-ballerina:localPublish && ./gradlew clean -x test -x check :tool-mi:localPublish + ./gradlew build + + - name: Generate Codecov Report + uses: codecov/codecov-action@v3