-
Notifications
You must be signed in to change notification settings - Fork 15
158 lines (131 loc) · 5.79 KB
/
Copy pathtest.yml
File metadata and controls
158 lines (131 loc) · 5.79 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
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@v4
with:
fetch-depth: 2
submodules: recursive
token: ${{ secrets.ACCESS_TOKEN }}
persist-credentials: false
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17.0.10
distribution: "adopt"
- 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: Accept Android SDK licences
run: yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses
- name: Bugfix libunwindstack-ndk .clang-format symbolic link issue
run: rm ./backtrace-library/src/main/cpp/libbun/external/libunwindstack-ndk/.clang-format
- name: Check Code Style
run: ./gradlew spotlessCheck
- name: Build and check
run: ./gradlew assembleDebug assembleDebugAndroidTest build check
- name: Alignment script executable
run: chmod +x scripts/check_elf_alignment.sh
- name: Verify 16-KB alignment (arm64-v8a & x86_64)
run: |
scripts/check_elf_alignment.sh \
example-app/build/outputs/apk/debug/example-app-debug.apk
- name: Upload symbols.zip
uses: actions/upload-artifact@v4
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@v4
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@v4
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@v4
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@v4
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@v4
with:
name: example-app-debug.apk
- name: Download Test APK
uses: actions/download-artifact@v4
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@v4
env:
GITHUB_TOKEN: ${{ github.token }}
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=".*,platformVersion=14" --region us-west-1
# 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=15.0" --region us-west-1
# 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=9.0" --region us-west-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=9" --region us-west-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)