From 0fcc223416e841943ff99dafb0dd9ad0f59cd184 Mon Sep 17 00:00:00 2001 From: Maruf Bepary Date: Mon, 20 Oct 2025 15:52:25 +0100 Subject: [PATCH] Implemented CICD pipeline - Checks build without tests - Checks if tests pass - Checks if Javadoc present --- .github/workflows/merge.yml | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/merge.yml diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml new file mode 100644 index 0000000..dc0f3f8 --- /dev/null +++ b/.github/workflows/merge.yml @@ -0,0 +1,56 @@ +name: CI Pipeline + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + build-and-test: + name: Build and Test (Java ${{ matrix.java-version }}) + runs-on: ubuntu-latest + + strategy: + matrix: + java-version: [17, 21, 25] + fail-fast: false + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java-version }} + distribution: 'temurin' + cache: 'gradle' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build (excluding tests) + run: ./gradlew build -x test + + - name: Run tests + run: ./gradlew test + + - name: Generate Javadoc + run: ./gradlew javadoc + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results-java-${{ matrix.java-version }} + path: build/reports/tests/test/ + + - name: Upload build reports + if: failure() + uses: actions/upload-artifact@v4 + with: + name: build-reports-java-${{ matrix.java-version }} + path: build/reports/ \ No newline at end of file