Skip to content

Commit 40468f9

Browse files
authored
CI: post Gradle log to issue on build failure
Temporary diagnostics step.
1 parent a4c6a32 commit 40468f9

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

‎.github/workflows/android-apk.yml‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: write
11+
issues: write
1112

1213
jobs:
1314
build:
@@ -37,7 +38,24 @@ jobs:
3738
gradle-version: "8.9"
3839

3940
- name: Build debug APK
40-
run: gradle --no-daemon :app:assembleDebug
41+
id: build_apk
42+
run: |
43+
set -o pipefail
44+
gradle --no-daemon :app:assembleDebug --stacktrace 2>&1 | tee build.log
45+
46+
- name: Post build log to diagnostics issue
47+
if: failure() && steps.build_apk.outcome == 'failure'
48+
env:
49+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: |
51+
{
52+
echo "Failing run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
53+
echo
54+
echo '```'
55+
tail -n 250 build.log
56+
echo '```'
57+
} > build-tail.md
58+
gh issue comment 4 --repo "${{ github.repository }}" --body-file build-tail.md
4159
4260
- name: Name APK for download
4361
run: cp app/build/outputs/apk/debug/app-debug.apk ScreenKit.apk

0 commit comments

Comments
 (0)