From 78f14811e92d1609b395c1158b9aa9d383dc3443 Mon Sep 17 00:00:00 2001 From: Ziyam Santhosh <50801227+ZiyamSanthosh@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:50:36 +0530 Subject: [PATCH] Create pr-builder.yml --- .github/workflows/pr-builder.yml | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/pr-builder.yml diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml new file mode 100644 index 0000000..6e22aa0 --- /dev/null +++ b/.github/workflows/pr-builder.yml @@ -0,0 +1,42 @@ +# This workflow will build the project on pull requests with tests +# Uses: +# OS: ubuntu-latest +# JDK: Adopt JDK 11 + +name: PR Builder + +on: + pull_request: + branches: [main, master] + workflow_dispatch: + +env: + MAVEN_OPTS: -Xmx4g -Xms1g + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Adopt JDK 11 + uses: actions/setup-java@v4 + with: + java-version: "11" + distribution: "temurin" + - name: Cache local Maven repository + id: cache-maven-m2 + uses: actions/cache@v4 + env: + cache-name: cache-m2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven-${{ env.cache-name }}- + ${{ runner.os }}-maven- + ${{ runner.os }}- + - name: Build with Maven + run: mvn clean install -U -B + - name: Generate coverage report + run: mvn test jacoco:report