File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -42,19 +42,22 @@ jobs:
4242 uses : gradle/gradle-build-action@v2
4343
4444 - name : Build with Gradle
45- run : ./gradlew build || echo "BUILD_FAILED=true" >> $GITHUB_ENV
46- continue-on-error : true
45+ run : ./gradlew build -x test
4746
47+ - name : Run Unit Tests with Gradle
48+ run : ./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
49+ continue-on-error : true
50+
4851 - name : Upload test reports if tests failed
49- if : env.BUILD_FAILED == 'true'
52+ if : env.UNIT_TEST_FAILED == 'true'
5053 uses : actions/upload-artifact@v4
5154 with :
5255 name : Unit Test Reports
5356 path : ' **/build/reports/tests/test'
5457 if-no-files-found : ignore # Prevents errors if no reports exist
5558
56- - name : Fail the job if build failed
57- if : env.BUILD_FAILED == 'true'
59+ - name : Fail the job if unit tests failed
60+ if : env.UNIT_TEST_FAILED == 'true'
5861 run : exit 1
5962
6063 # TODO: Move the sidecar into a central image repository
You can’t perform that action at this time.
0 commit comments