1- name : PR Unit Tests
1+ name : CI
22
33on :
4+ push :
5+ branches : [main]
46 pull_request :
5- types : [ opened, reopened, synchronize ]
67
78permissions :
89 contents : read
910
1011jobs :
11- pr_checks :
12+ tests :
1213 runs-on : ubuntu-latest
1314 steps :
14- - name : Checkout
15- uses : actions/checkout@v4
16-
17- - name : Validate Gradle Wrapper
18- uses : gradle/actions/wrapper-validation@v3
19-
20- - name : Set up JDK 17
21- uses : actions/setup-java@v4
15+ - uses : actions/checkout@v4
16+ - uses : gradle/actions/wrapper-validation@v3
17+ - uses : actions/setup-java@v4
2218 with :
2319 distribution : temurin
2420 java-version : 17
2521
26- - name : Cache Gradle
27- uses : actions/cache@v4
22+ - uses : actions/cache@v4
2823 with :
2924 path : |
3025 ~/.gradle/caches
@@ -33,39 +28,11 @@ jobs:
3328 restore-keys : |
3429 gradle-${{ runner.os }}-
3530
36- - name : Run Detekt
37- run : ./gradlew --no-daemon --console=plain :core:detekt
38- - name : Show Detekt summary
39- if : always()
40- run : |
41- SUMMARY_MD=core/build/reports/detekt/detekt.md
42- if [ -f "$SUMMARY_MD" ]; then
43- echo -e "## Detekt Report\n" >> "$GITHUB_STEP_SUMMARY"
44- cat "$SUMMARY_MD" >> "$GITHUB_STEP_SUMMARY"
45- else
46- echo "Detekt report not found."
47- fi
48-
49- - name : Run unit tests
50- run : ./gradlew --no-daemon jvmTest
31+ - name : Compile
32+ run : ./gradlew --no-daemon --console=plain :core:assemble
5133
52- - name : Verify test reports exist
53- run : |
54- set -e
55- count=$(find . -type f -path '*build/test-results/*/TEST-*.xml' 2>/dev/null | wc -l || true)
56- echo "Discovered $count test report files."
57- if [ "$count" -eq 0 ]; then
58- echo "Check locally that all works okay, you can use this command to check ./gradlew jvmTest"
59- exit 1
60- fi
34+ - name : Detekt
35+ run : ./gradlew --no-daemon --console=plain :core:detekt
6136
62- - name : Upload test reports
63- if : always()
64- uses : actions/upload-artifact@v4
65- with :
66- name : test-reports
67- path : |
68- **/build/test-results
69- **/build/reports/tests
70- if-no-files-found : ignore
71- retention-days : 7
37+ - name : Test
38+ run : ./gradlew --no-daemon --console=plain :core:jvmTest
0 commit comments