Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/build-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Fineract Build Core

on:
workflow_call:

permissions:
contents: read

jobs:
build-core:
runs-on: ubuntu-24.04
timeout-minutes: 60

env:
TZ: Asia/Kolkata
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true

- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '21'
distribution: 'zulu'

- name: Cache Gradle dependencies
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}

- name: Setup Gradle and Validate Wrapper
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
with:
validate-wrappers: true

- name: Build Avro Java SDK
run: ./gradlew --no-daemon :fineract-avro-schemas:buildJavaSdk -x test -x cucumber -x doc -x javadoc -x javadocJar -x checkstyleMain -x checkstyleTest -x checkstyleJmh -x spotbugsMain -x spotbugsTest -x spotlessCheck -x spotlessApply -x rat

- name: Compile Fineract Provider
run: ./gradlew --no-daemon :fineract-provider:compileJava -x test -x cucumber -x doc -x buildJavaSdk -x javadoc -x javadocJar -x checkstyleMain -x checkstyleTest -x checkstyleJmh -x spotbugsMain -x spotbugsTest -x spotlessCheck -x spotlessApply -x rat

- name: Generate Fineract Git Properties
run: ./gradlew --no-daemon :fineract-provider:generateGitProperties -x javadoc -x javadocJar -x checkstyleMain -x checkstyleTest -x checkstyleJmh -x spotbugsMain -x spotbugsTest -x spotlessCheck -x spotlessApply -x rat

- name: Verify generated git.properties
run: test -f fineract-provider/build/resources/main/git.properties

- name: Build Fineract Client Java SDK
run: ./gradlew --no-daemon :fineract-client:buildJavaSdk -x test -x cucumber -x doc -x javadoc -x javadocJar -x checkstyleMain -x checkstyleTest -x checkstyleJmh -x spotbugsMain -x spotbugsTest -x spotlessCheck -x spotlessApply -x rat

- name: Build Fineract Client Feign Java SDK
run: ./gradlew --no-daemon :fineract-client-feign:buildJavaSdk -x test -x cucumber -x doc -x javadoc -x javadocJar -x checkstyleMain -x checkstyleTest -x checkstyleJmh -x spotbugsMain -x spotbugsTest -x spotlessCheck -x spotlessApply -x rat

- name: Build Fineract
run: ./gradlew --no-daemon build -x test -x cucumber -x doc -x javadoc -x javadocJar -x checkstyleMain -x checkstyleTest -x checkstyleJmh -x spotbugsMain -x spotbugsTest -x spotlessCheck -x spotlessApply -x rat

- name: Pack workspace
run: |
tar --exclude='./fineract-workspace.tar' -cf fineract-workspace.tar .

- name: Upload workspace
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: fineract-workspace-${{ github.run_id }}
path: fineract-workspace.tar
retention-days: 1

- name: Archive test results
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: test-results-build-core
path: '**/build/reports/'
if-no-files-found: ignore
retention-days: 5

- name: Archive server logs
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: server-logs-build-core
path: '**/build/cargo/'
retention-days: 5
89 changes: 16 additions & 73 deletions .github/workflows/build-cucumber.yml
Original file line number Diff line number Diff line change
@@ -1,114 +1,57 @@
name: Fineract Build & Cucumber tests (without E2E tests)
name: Fineract Cucumber tests (without E2E tests)

on: [push, pull_request]
on:
workflow_call:

permissions:
contents: read

jobs:
verify:
cucumber:
runs-on: ubuntu-24.04
timeout-minutes: 60

strategy:
fail-fast: false
matrix:
include:
- task: build-core
job_type: main
- task: cucumber
job_type: main
- task: build-progressive-loan
job_type: progressive-loan

env:
TZ: Asia/Kolkata
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true

- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '21'
distribution: 'zulu'

- name: Cache Gradle dependencies
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
- name: Download workspace
uses: actions/download-artifact@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
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: Run Gradle Task
if: matrix.job_type == 'main'
run: |
set -e # Fail the script if any command fails

case "${{ matrix.task }}" in
build-core)
./gradlew --no-daemon build -x test -x cucumber -x doc
;;
cucumber)
./gradlew --no-daemon cucumber -x :fineract-e2e-tests-runner:cucumber -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer
;;
esac

- name: Build and Test Progressive Loan
if: matrix.job_type == 'progressive-loan'
run: |
# Build the JAR
./gradlew --no-daemon --console=plain :fineract-progressive-loan-embeddable-schedule-generator:shadowJar

# 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

# 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: Run Cucumber
run: ./gradlew --no-daemon cucumber -x :fineract-e2e-tests-runner:cucumber -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer -x buildJavaSdk

- name: Archive test results
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: test-results-${{ matrix.task }}
path: |
**/build/reports/
**/fineract-progressive-loan-embeddable-schedule-generator/build/reports/
name: test-results-cucumber
path: '**/build/reports/'
if-no-files-found: ignore
retention-days: 5

- name: Archive Progressive Loan JAR
if: matrix.job_type == 'progressive-loan' && 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-${{ matrix.task }}
name: server-logs-cucumber
path: '**/build/cargo/'
retention-days: 5
29 changes: 22 additions & 7 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Fineract Docker Builds

on: [push, pull_request]
on:
workflow_call:

permissions:
contents: read
Expand All @@ -26,21 +27,32 @@ jobs:
IMAGE_NAME: fineract

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '21'
distribution: 'zulu'

- name: Download workspace
uses: actions/download-artifact@v5
with:
name: fineract-workspace-${{ github.run_id }}
path: .

- name: Extract workspace
run: tar -xf fineract-workspace.tar

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2

- name: Build the image
run: ./gradlew --no-daemon --console=plain :fineract-provider:jibDockerBuild -Djib.to.image=$IMAGE_NAME -x test -x cucumber
run: ./gradlew --no-daemon --console=plain :fineract-provider:jibDockerBuild -Djib.to.image=$IMAGE_NAME -x test -x cucumber -x buildJavaSdk

- name: Verify git.properties in image
run: |
docker create --name fineract-inspect $IMAGE_NAME
docker export fineract-inspect | tar -tf - | grep 'git.properties'
docker rm fineract-inspect

- name: Start the ${{ matrix.db_type }} stack
run: docker compose -f ${{ matrix.compose_file }} up -d
Expand All @@ -52,4 +64,7 @@ jobs:
run: curl -f -k --retry 60 --retry-all-errors --connect-timeout 30 --retry-delay 30 https://localhost:8443/fineract-provider/actuator/health

- name: Check info Manager
run: (( $(curl -f -k --retry 5 --retry-all-errors --connect-timeout 30 --retry-delay 30 https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 ))
run: |
curl -f -k --retry 5 --retry-all-errors --connect-timeout 30 --retry-delay 30 https://localhost:8443/fineract-provider/actuator/info -o actuator-info.json
cat actuator-info.json
jq -e '.git | type == "object"' actuator-info.json
16 changes: 10 additions & 6 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Fineract Documentation build
on: [push, pull_request]
on:
workflow_call:
permissions:
contents: read
jobs:
Expand All @@ -9,15 +10,18 @@ jobs:
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '21'
distribution: 'zulu'
- name: Download workspace
uses: actions/download-artifact@v5
with:
name: fineract-workspace-${{ github.run_id }}
path: .
- name: Extract workspace
run: tar -xf fineract-workspace.tar
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
Expand All @@ -32,4 +36,4 @@ jobs:
sudo apt-get update
sudo apt-get install ghostscript graphviz -y
- name: Documentation build
run: ./gradlew --no-daemon --console=plain doc
run: ./gradlew --no-daemon --console=plain doc -x buildJavaSdk
25 changes: 17 additions & 8 deletions .github/workflows/build-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Fineract E2E Tests

on: [push, pull_request]
on:
workflow_call:

permissions:
contents: read
Expand Down Expand Up @@ -32,17 +33,21 @@ jobs:
ACTIVEMQ_TOPIC_NAME: events

steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '21'
distribution: 'zulu'

- name: Download workspace
uses: actions/download-artifact@v5
with:
name: fineract-workspace-${{ github.run_id }}
path: .

- name: Extract workspace
run: tar -xf fineract-workspace.tar

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2

Expand All @@ -57,7 +62,7 @@ jobs:
cat feature_shard_${{ matrix.shard_index }}.txt

- name: Build the image
run: ./gradlew --no-daemon --console=plain :fineract-provider:jibDockerBuild -Djib.to.image=$IMAGE_NAME -x test -x cucumber
run: ./gradlew --no-daemon --console=plain :fineract-provider:jibDockerBuild -Djib.to.image=$IMAGE_NAME -x test -x cucumber -x buildJavaSdk

- name: Start the Fineract stack
run: docker compose -f docker-compose-postgresql-test-activemq.yml up -d
Expand Down Expand Up @@ -116,7 +121,11 @@ jobs:
:fineract-e2e-tests-runner:cucumber \
-Pcucumber.features="$feature_file" \
-Dallure.results.directory="allure-results-shard-${{ matrix.shard_index }}/$safe_name" \
allureReport; then
allureReport \
-x buildJavaSdk \
-x :fineract-client:buildJavaSdk \
-x :fineract-client-feign:buildJavaSdk \
-x :fineract-avro-schemas:buildJavaSdk; then

echo "::error::Test failed for $feature_file"
FAILED=1
Expand Down
Loading
Loading