Issue#100 Save Logcat logs into file and upload Artifact
This commit is contained in:
parent
3d787b37aa
commit
0ca1d7d9c8
2 changed files with 14 additions and 5 deletions
7
.github/workflows/pull-request-jobs.yml
vendored
7
.github/workflows/pull-request-jobs.yml
vendored
|
|
@ -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
|
||||||
|
|
@ -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)
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue