| name: Fineract Progressive Loan build |
| |
| on: |
| workflow_call: |
| |
| permissions: |
| contents: read |
| |
| jobs: |
| build-progressive-loan: |
| runs-on: ubuntu-24.04 |
| timeout-minutes: 60 |
| |
| env: |
| TZ: Asia/Kolkata |
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} |
| |
| steps: |
| - name: Set up JDK 21 |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 |
| with: |
| java-version: '21' |
| distribution: 'zulu' |
| |
| - name: Download workspace |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 |
| with: |
| name: fineract-workspace-${{ github.run_id }} |
| path: . |
| |
| - name: Extract workspace |
| run: tar -xf fineract-workspace.tar |
| |
| - name: Setup Gradle and Validate Wrapper |
| uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2 |
| with: |
| validate-wrappers: true |
| |
| - name: Build and Test Progressive Loan |
| run: | |
| # Build the JAR |
| ./gradlew --no-daemon --console=plain :fineract-progressive-loan-embeddable-schedule-generator:shadowJar -x buildJavaSdk |
| |
| # Store the JAR filename in an environment variable |
| EMBEDDABLE_JAR_FILE=$(ls fineract-progressive-loan-embeddable-schedule-generator/build/libs/*-all.jar | head -n 1) |
| echo "EMBEDDABLE_JAR_FILE=$EMBEDDABLE_JAR_FILE" >> $GITHUB_ENV |
| echo "JAR file: $EMBEDDABLE_JAR_FILE" |
| |
| # Run unit tests |
| ./gradlew --no-daemon --console=plain :fineract-progressive-loan-embeddable-schedule-generator:test -x buildJavaSdk |
| |
| # Build and run sample application |
| mkdir -p sample-app |
| javac -cp "$EMBEDDABLE_JAR_FILE" -d sample-app fineract-progressive-loan-embeddable-schedule-generator/misc/Main.java |
| java -cp "$EMBEDDABLE_JAR_FILE:sample-app" Main |
| java -cp "$EMBEDDABLE_JAR_FILE:sample-app" Main 25 |
| |
| - name: Archive test results |
| if: always() |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| with: |
| name: test-results-build-progressive-loan |
| path: | |
| **/build/reports/ |
| **/fineract-progressive-loan-embeddable-schedule-generator/build/reports/ |
| if-no-files-found: ignore |
| retention-days: 5 |
| |
| - name: Archive Progressive Loan JAR |
| if: always() |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| with: |
| name: progressive-loan-jar |
| path: ${{ env.EMBEDDABLE_JAR_FILE }} |
| retention-days: 5 |
| if-no-files-found: ignore |
| |
| - name: Archive server logs |
| if: always() |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| with: |
| name: server-logs-build-progressive-loan |
| path: '**/build/cargo/' |
| retention-days: 5 |