|
1 | | -name: Fineract Build & Cucumber tests (without E2E tests) |
| 1 | +name: Fineract Cucumber tests (without E2E tests) |
2 | 2 |
|
3 | | -on: [push, pull_request] |
| 3 | +on: |
| 4 | + workflow_call: |
4 | 5 |
|
5 | 6 | permissions: |
6 | 7 | contents: read |
7 | 8 |
|
8 | 9 | jobs: |
9 | | - verify: |
| 10 | + cucumber: |
10 | 11 | runs-on: ubuntu-24.04 |
11 | 12 | timeout-minutes: 60 |
12 | 13 |
|
13 | | - strategy: |
14 | | - fail-fast: false |
15 | | - matrix: |
16 | | - include: |
17 | | - - task: build-core |
18 | | - job_type: main |
19 | | - - task: cucumber |
20 | | - job_type: main |
21 | | - - task: build-progressive-loan |
22 | | - job_type: progressive-loan |
23 | | - |
24 | 14 | env: |
25 | 15 | TZ: Asia/Kolkata |
26 | 16 | DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} |
27 | 17 |
|
28 | 18 | steps: |
29 | | - - name: Checkout |
30 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
31 | | - with: |
32 | | - fetch-depth: 0 |
33 | | - fetch-tags: true |
34 | | - |
35 | 19 | - name: Set up JDK 21 |
36 | 20 | uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 |
37 | 21 | with: |
38 | 22 | java-version: '21' |
39 | 23 | distribution: 'zulu' |
40 | 24 |
|
41 | | - - name: Cache Gradle dependencies |
42 | | - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 |
| 25 | + - name: Download workspace |
| 26 | + uses: actions/download-artifact@v5 |
43 | 27 | with: |
44 | | - path: | |
45 | | - ~/.gradle/caches |
46 | | - ~/.gradle/wrapper |
47 | | - key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 28 | + name: fineract-workspace-${{ github.run_id }} |
| 29 | + path: . |
| 30 | + |
| 31 | + - name: Extract workspace |
| 32 | + run: tar -xf fineract-workspace.tar |
48 | 33 |
|
49 | 34 | - name: Setup Gradle and Validate Wrapper |
50 | 35 | uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2 |
51 | 36 | with: |
52 | 37 | validate-wrappers: true |
53 | 38 |
|
54 | | - - name: Run Gradle Task |
55 | | - if: matrix.job_type == 'main' |
56 | | - run: | |
57 | | - set -e # Fail the script if any command fails |
58 | | -
|
59 | | - case "${{ matrix.task }}" in |
60 | | - build-core) |
61 | | - ./gradlew --no-daemon build -x test -x cucumber -x doc |
62 | | - ;; |
63 | | - cucumber) |
64 | | - ./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 |
65 | | - ;; |
66 | | - esac |
67 | | -
|
68 | | - - name: Build and Test Progressive Loan |
69 | | - if: matrix.job_type == 'progressive-loan' |
70 | | - run: | |
71 | | - # Build the JAR |
72 | | - ./gradlew --no-daemon --console=plain :fineract-progressive-loan-embeddable-schedule-generator:shadowJar |
73 | | -
|
74 | | - # Store the JAR filename in an environment variable |
75 | | - EMBEDDABLE_JAR_FILE=$(ls fineract-progressive-loan-embeddable-schedule-generator/build/libs/*-all.jar | head -n 1) |
76 | | - echo "EMBEDDABLE_JAR_FILE=$EMBEDDABLE_JAR_FILE" >> $GITHUB_ENV |
77 | | - echo "JAR file: $EMBEDDABLE_JAR_FILE" |
78 | | -
|
79 | | - # Run unit tests |
80 | | - ./gradlew --no-daemon --console=plain :fineract-progressive-loan-embeddable-schedule-generator:test |
81 | | -
|
82 | | - # Build and run sample application |
83 | | - mkdir -p sample-app |
84 | | - javac -cp "$EMBEDDABLE_JAR_FILE" -d sample-app fineract-progressive-loan-embeddable-schedule-generator/misc/Main.java |
85 | | - java -cp "$EMBEDDABLE_JAR_FILE:sample-app" Main |
86 | | - java -cp "$EMBEDDABLE_JAR_FILE:sample-app" Main 25 |
| 39 | + - name: Run Cucumber |
| 40 | + 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 |
87 | 41 |
|
88 | 42 | - name: Archive test results |
89 | 43 | if: always() |
90 | 44 | uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
91 | 45 | with: |
92 | | - name: test-results-${{ matrix.task }} |
93 | | - path: | |
94 | | - **/build/reports/ |
95 | | - **/fineract-progressive-loan-embeddable-schedule-generator/build/reports/ |
| 46 | + name: test-results-cucumber |
| 47 | + path: '**/build/reports/' |
96 | 48 | if-no-files-found: ignore |
97 | 49 | retention-days: 5 |
98 | 50 |
|
99 | | - - name: Archive Progressive Loan JAR |
100 | | - if: matrix.job_type == 'progressive-loan' && always() |
101 | | - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
102 | | - with: |
103 | | - name: progressive-loan-jar |
104 | | - path: ${{ env.EMBEDDABLE_JAR_FILE }} |
105 | | - retention-days: 5 |
106 | | - if-no-files-found: ignore |
107 | | - |
108 | 51 | - name: Archive server logs |
109 | 52 | if: always() |
110 | 53 | uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
111 | 54 | with: |
112 | | - name: server-logs-${{ matrix.task }} |
| 55 | + name: server-logs-cucumber |
113 | 56 | path: '**/build/cargo/' |
114 | 57 | retention-days: 5 |
0 commit comments