| 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 |