Skip to content

Commit 538033c

Browse files
committed
Enhance build validation workflow to handle build failures by uploading test reports and failing the job if necessary
1 parent f7c5376 commit 538033c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/build-validation.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,20 @@ jobs:
4242
uses: gradle/gradle-build-action@v2
4343

4444
- name: Build with Gradle
45-
run: ./gradlew build --stacktrace
45+
run: ./gradlew build || echo "BUILD_FAILED=true" >> $GITHUB_ENV
46+
continue-on-error: true
4647

48+
- name: Upload test reports if tests failed
49+
if: env.BUILD_FAILED == 'true'
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: Unit Test Reports
53+
path: '**/build/reports/tests/test'
54+
if-no-files-found: ignore # Prevents errors if no reports exist
55+
56+
- name: Fail the job if build failed
57+
if: env.BUILD_FAILED == 'true'
58+
run: exit 1
4759

4860
# TODO: Move the sidecar into a central image repository
4961
- name: Initialize Durable Task Sidecar

0 commit comments

Comments
 (0)