This repository was archived by the owner on Jan 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,19 @@ jobs:
50
50
51
51
- name : Run instrumentation tests
52
52
uses : reactivecircus/android-emulator-runner@v2
53
+ continue-on-error : true # IMPORTANT: allow pipeline to continue to Android Test Report step
53
54
with :
54
55
api-level : 26
55
56
arch : x86
56
57
profile : Nexus 6
57
58
disable-animations : true
58
- script : ./gradlew connectedCheck --stacktrace
59
59
working-directory : ${{ env.SAMPLE_PATH }}
60
+ script : |
61
+ adb logcat -c # clear logs
62
+ touch app/emulator.log # create log file
63
+ chmod 777 app/emulator.log # allow writing to log file
64
+ adb logcat >> app/emulator.log & # pipe all logcat messages into log file as a background process
65
+ ./gradlew connectedCheck # here run your tests
60
66
61
67
- name : Upload build outputs (APKs)
62
68
uses : actions/upload-artifact@v3
70
76
with :
71
77
name : build-reports-NavigationAdvancedSample
72
78
path : ${{ env.SAMPLE_PATH }}/app/build/reports
79
+
80
+ - name : Upload Failing Test Report Log
81
+ if : steps.testing.outcome != 'success' # upload the generated log on failure of the tests job
82
+ uses : actions/upload-artifact@v2
83
+ with :
84
+ name : logs
85
+ path : app/emulator.log # path to where the log is
86
+
87
+ - name : Raise error on test fail # set a red tick on the workflow run if the tests failed
88
+ if : steps.testing.outcome != 'success'
89
+ run : exit 1
You can’t perform that action at this time.
0 commit comments