Skip to content

Commit 5ba2a1e

Browse files
ci: capture full build log, add diagnostic steps
- Save assembleDebug output to /tmp/build.log with tee - Use 'set -o pipefail' to preserve gradle exit code - Add 'Show build errors' step (if: failure) to surface the cause - Add 'List APK directory' step to verify output path - Upload build-log artifact for post-mortem analysis Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 8a0881e commit 5ba2a1e

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/android-build.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,34 @@ jobs:
106106
echo "=== Gradle Version ==="
107107
/opt/gradle-8.7/bin/gradle --version 2>&1 | head -3
108108
echo "=== Building ==="
109-
/opt/gradle-8.7/bin/gradle assembleDebug --stacktrace --no-daemon 2>&1 | tail -120
109+
set -o pipefail
110+
/opt/gradle-8.7/bin/gradle assembleDebug --stacktrace --no-daemon 2>&1 | tee /tmp/build.log
110111
env:
111112
ANDROID_SDK_ROOT: /usr/local/lib/android/sdk
112113

114+
- name: Show build errors
115+
if: failure()
116+
run: |
117+
echo "=== Last 200 lines ==="
118+
tail -200 /tmp/build.log
119+
echo "=== Error markers ==="
120+
grep -iE 'error:|FAILED|Unresolved|Exception|BUILD FAILED|cannot find' /tmp/build.log || echo "(no markers)"
121+
122+
- name: List APK directory
123+
if: always()
124+
run: find android/app/build/outputs/apk/ -type f 2>/dev/null || echo "(dir not found)"
125+
113126
- name: Upload APK artifact
114127
uses: actions/upload-artifact@v4
115128
with:
116129
name: app-debug
117130
path: android/app/build/outputs/apk/debug/app-debug.apk
118131
retention-days: 30
132+
133+
- name: Upload build log
134+
uses: actions/upload-artifact@v4
135+
if: always()
136+
with:
137+
name: build-log
138+
path: /tmp/build.log
139+
retention-days: 7

0 commit comments

Comments
 (0)