Issue#100 Save Logcat logs into file and upload Artifact

This commit is contained in:
Gergely Hegedus 2022-07-14 10:24:33 +03:00
parent 3d787b37aa
commit 0ca1d7d9c8
2 changed files with 14 additions and 5 deletions

View file

@ -131,3 +131,10 @@ jobs:
name: Emulator-Test-Results-${{ matrix.api-level }} name: Emulator-Test-Results-${{ matrix.api-level }}
path: ./**/build/testscreenshots/* path: ./**/build/testscreenshots/*
retention-days: 1 retention-days: 1
- name: Upload Logcat Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: Emulator-Logcat-Logs-${{ matrix.api-level }}
path: ./**/build/logcat.txt
retention-days: 1

View file

@ -98,12 +98,14 @@ task removeLocalScreenshots(type: Delete) {
delete files("$savePath") delete files("$savePath")
} }
task showLogcat(type: Exec) { task saveLogcatLogs(type: Exec) {
group = 'Test-Screenshots' group = 'Test-Screenshots'
description = 'Show Logcat' description = 'Show Logcat'
//adb logcat -d doFirst {
commandLine "$adb", 'logcat', '-d' standardOutput = new FileOutputStream("${buildDir}/logcat.txt")
}
commandLine "$adb", 'logcat', '-d'
} }
task hasScreenshots(type: Exec) { task hasScreenshots(type: Exec) {
@ -111,7 +113,7 @@ task hasScreenshots(type: Exec) {
} }
afterEvaluate { afterEvaluate {
connectedDebugAndroidTest.finalizedBy showLogcat connectedDebugAndroidTest.finalizedBy saveLogcatLogs
showLogcat.finalizedBy pullScreenshots saveLogcatLogs.finalizedBy pullScreenshots
clean.dependsOn(removeLocalScreenshots) clean.dependsOn(removeLocalScreenshots)
} }