-
Notifications
You must be signed in to change notification settings - Fork 11
140 lines (118 loc) · 5.06 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Run Tests
on:
push:
branches: [master]
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout submodules
uses: actions/checkout@v3
with:
fetch-depth: 2
submodules: recursive
token: ${{ secrets.ACCESS_TOKEN }}
persist-credentials: false
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11.0.10
distribution: "adopt"
cache: gradle
- name: Write to local.properties
run: |
echo BACKTRACE_SUBMISSION_URL=\"${{ secrets.BACKTRACE_SUBMISSION_URL }}\" >> ./local.properties
echo BACKTRACE_CORONER_URL=\"${{ secrets.BACKTRACE_CORONER_URL }}\" >> ./local.properties
echo BACKTRACE_CORONER_TOKEN=\"${{ secrets.BACKTRACE_CORONER_TOKEN }}\" >> ./local.properties
- name: Build and check
run: ./gradlew assembleDebug assembleDebugAndroidTest build check
- name: Upload symbols.zip
uses: actions/upload-artifact@v3
with:
name: native-debug-symbols.zip
path: example-app/build/outputs/native-debug-symbols/release/native-debug-symbols.zip
- name: Upload example-app APK
uses: actions/upload-artifact@v3
with:
name: example-app-debug.apk
path: example-app/build/outputs/apk/debug/example-app-debug.apk
- name: Upload example-app Test APK
uses: actions/upload-artifact@v3
with:
name: example-app-debug-androidTest.apk
path: example-app/build/outputs/apk/androidTest/debug/example-app-debug-androidTest.apk
- name: Upload backtrace-library AAR
uses: actions/upload-artifact@v3
with:
name: backtrace-library-debug.aar
path: backtrace-library/build/outputs/aar/backtrace-library-debug.aar
- name: Upload backtrace-library Test APK
uses: actions/upload-artifact@v3
with:
name: backtrace-library-debug-androidTest.apk
path: backtrace-library/build/outputs/apk/androidTest/debug/backtrace-library-debug-androidTest.apk
test:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
test-apk:
[
example-app-debug-androidTest.apk,
backtrace-library-debug-androidTest.apk,
]
steps:
- name: Download APK
uses: actions/download-artifact@v3
with:
name: example-app-debug.apk
- name: Download Test APK
uses: actions/download-artifact@v3
with:
name: ${{ matrix.test-apk }}
- name: Get Saucectl
run: curl -L https://saucelabs.github.io/saucectl/install | bash
- name: Install saucectl
uses: saucelabs/saucectl-run-action@v3
with:
skip-run: true
- name: Run Saucectl
run: |
saucectl configure --username ${{ secrets.SAUCE_USERNAME }} --accessKey ${{ secrets.SAUCE_ACCESS_KEY }}
# recent real device
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --device name="Samsung_Galaxy_S20_FE_5G_backtrace_us"
# newest Android version
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --emulator name="Android GoogleApi Emulator,platformVersion=12.0"
# oldest Android version
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --emulator name="Android GoogleApi Emulator,platformVersion=5.1"
# oldest real device (aiming for armv7 / 32bit)
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --device name=".*,platformVersion=6.0.1"
# --device name=".*,platformVersion=6.0.1"
# --device name="Samsung_Galaxy_S20_FE_5G_backtrace_us"
# --device name="Samsung_Galaxy_S22_Ultra_5G_backtrace_us"
- name: Run morgue
run: |
npm install backtrace-morgue --location=global
morgue --version || true
# Todo: currently just looks 15 minutes in the past and doesn't filter at all.
# --csv=crash.csv
morgue --token=${{ secrets.BACKTRACE_API_TOKEN }} --endpoint="https://yolo.sp.backtrace.io" list yolo/android-library --select timestamp --filter=timestamp,greater-than,`date +%s%3N -d "15 minutes ago"` || true
# if [ $(wc -l < crash.csv) -gt 0 ]; then
# echo "Success"
# else
# exit 1
# fi
# runs-on: macos-latest # necessary for reactivecircus/android-emulator-runner@v2
# - name: Emulator test
# uses: reactivecircus/android-emulator-runner@v2
# with:
# target: google_apis
# api-level: ${{ matrix.api-level }}
# arch: x86_64
# script: ./gradlew connectedCheck
# - name: Code coverage
# run: bash <(curl -s https://codecov.io/bash)