Skip to content

Commit 8d530cb

Browse files
committed
separate build and unit tests
1 parent 637863c commit 8d530cb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/build-validation.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)