-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (170 loc) · 9.44 KB
/
build_x86_64_google_apis_playstore.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: build_x86_64_google_apis_playstore
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 */12 * * *' # 分 时 日 月 周
jobs:
build:
runs-on: macOS-11
if: "!startsWith(github.event.head_commit.message, 'GitHubAction:')"
strategy:
matrix:
api-level: [ 28, 29, 30, 31, 32, 33]
target: [google_apis_playstore]
arch: [x86_64]
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
#cache: gradle
- name: Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
- name: AVD cache
uses: actions/cache@v2
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-cache
- name: checkout analysys-dev-sdk and sync
shell: bash
continue-on-error: true
run: |
git clone https://oauth2:${{ secrets.GTOKEN }}@github.com/analysys-sdk/analysys-dev-sdk.git
echo "===========clone over===================="
ls
cd analysys-dev-sdk
echo "===========into analysys-dev-sdk===================="
ls
git checkout dev
chmod -R 777 *
git config core.filemode false
brew install coreutils
- name: build analysys-dev-sdk
shell: bash
continue-on-error: true
run: |
cd analysys-dev-sdk
rm -rf dev-sdk/src/main/java/com/analysys/plugin
rm -rf dev-sdk/src/androidTest/java/com/analysys/plugin/
rm -rf dev-sdk/src/androidTest/java/com/miqt/
./replace.sh
echo "=====================查看当前目录====================="
ls
echo "=====================查看变动====================="
git status
git diff
./gradlew build || true
- name: copy result
shell: bash
continue-on-error: true
run: |
cp ./analysys-dev-sdk/dev-sdk/build/outputs/aar/dev-sdk-debug.aar ./dev-sdk-debug.aar
cp ./analysys-dev-sdk/dev-sdk/build/outputs/aar/dev-sdk-release.aar ./dev-sdk-release.aar
cp ./analysys-dev-sdk/appdemo/build/outputs/apk/debug/appdemo-debug.apk ./appdemo-debug.apk
echo "============拷贝完成,查看当前目录=============="
ls
- name: RUN app and monkey
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
profile: Nexus 6
avd-name: ${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: |
echo "=====================查看当前目录====================="
ls
adb install -r ./appdemo-debug.apk
adb shell pm list package || true
wget https://raw.githubusercontent.com/TestJken66/Fastbot_Android/main/fastbot-thirdpart.jar
wget https://raw.githubusercontent.com/TestJken66/Fastbot_Android/main/monkeyq.jar
wget https://raw.githubusercontent.com/TestJken66/Fastbot_Android/main/framework.jar
adb push framework.jar /sdcard ||true
adb push monkeyq.jar /sdcard ||true
adb push fastbot-thirdpart.jar /sdcard ||true
wget https://raw.githubusercontent.com/TestJken66/Fastbot_Android/main/libs/arm64-v8a/libfastbot_native.so -P libs/arm64-v8a/
wget https://raw.githubusercontent.com/TestJken66/Fastbot_Android/main/libs/armeabi-v7a/libfastbot_native.so -P libs/armeabi-v7a/
wget https://raw.githubusercontent.com/TestJken66/Fastbot_Android/main/libs/x86/libfastbot_native.so -P libs/x86/
wget https://raw.githubusercontent.com/TestJken66/Fastbot_Android/main/libs/x86_64/libfastbot_native.so -P libs/x86_64/
chmod -R 777 *
adb push libs/arm64-v8a/ /data/local/tmp/ ||true
adb push libs/armeabi-v7a/ /data/local/tmp/ ||true
adb push libs/x86/ /data/local/tmp/ ||true
adb push libs/x86_64/ /data/local/tmp/ ||true
# cn.analysys.casedemo
# adb shell CLASSPATH=/sdcard/monkeyq.jar:/sdcard/framework.jar:/sdcard/fastbot-thirdpart.jar exec app_process /system/bin com.android.commands.monkey.Monkey -p cn.analysys.casedemo --agent reuseq --bugreport --output-directory /sdcard/mbugs --running-minutes 3 --throttle 500 -v -v || true
#com.device
gtimeout 1h adb shell CLASSPATH=/sdcard/monkeyq.jar:/sdcard/framework.jar:/sdcard/fastbot-thirdpart.jar exec app_process /system/bin com.android.commands.monkey.Monkey -p com.device --agent reuseq --bugreport --output-directory /sdcard/mbugs --running-minutes 3 --throttle 500 -v -v || true
echo "。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。"
echo "。。。。。。。。。。。。。。。。。。运行完毕了。。。。。。。。。。。。。。。。。。。"
echo "。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。"
adb pull /sdcard/mbugs . || true
echo "${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }} 运行完毕。。。。。。。。。"
rm -rf ~/.android/avd/
- name: ypload
shell: bash
continue-on-error: true
run: |
tar zcvf monkey_${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}.tgz mbugs/ ||true
echo "${{github.repository_owner}} will upload files"
#######################################################################################################
######################################## upload files #################################################
#######################################################################################################
file_name=monkey_${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}.tgz
wget https://github.com/hhhaiai/uploadGithub/releases/download/v1.1/uploadGithubService-1.1-jar-with-dependencies.jar
dat=$(date "+%H%M%S")
tpn=${{ github.repository }}
pn=`echo $tpn | cut -d \/ -f 2`
us=${{github.repository_owner}}
# echo "project name: ${pn}"
today=$(date "+%Y%m%d")
upload_file_name="ci/$today/${pn}_${dat}_${file_name}"
chmod -R 777 *
echo "=================下载完成文件查看===================="
ls
# https://docs.github.com/cn/actions/learn-github-actions/contexts#github-context
echo "dat: $dat">>${file_name}
echo "upload_file_name: $upload_file_name">>${file_name}
echo "Project: ${{ github.repository }}">>${file_name}
echo "Job: ${{ github.job }}">>${file_name}
echo "Build commit sha: ${{ github.sha }}">>${file_name}
echo "job.container.id: ${{ job.container.id }}">>${file_name}
echo "job.container.network: ${{ job.container.network }}">>${file_name}
echo "===========================">>${file_name}
# java -jar uploadGithubService-1.1-jar-with-dependencies.jar -owner hhhaiai -repo Git_result -target-dir-full-name $upload_file_name -native-file ${file_name} -token ${{ secrets.GTOKEN }} -commit-messge "GitHubAction: Build commit ${{ github.sha }}. Project: ${{ github.repository }} Job ${{ github.job }}, created by ${{ github.workflow }} " -commit-auther "UploadGithubService" -commit-email "sanbo.xyz@gmail.com"
java -jar uploadGithubService-1.1-jar-with-dependencies.jar -owner hhhaiai -repo Git_result -target-dir-full-name $upload_file_name -native-file ${file_name} -token ${{ secrets.GTOKEN }} -commit-messge "GitHubAction: Build&Monkey ${{ github.repository }} Job ${{ github.job }}, created by ${{ github.workflow }} " -commit-auther "GitHubAction" -commit-email "sanbo.xyz@gmail.com"
- name: Send mail
uses: dawidd6/action-send-mail@v3
with:
# server_address: smtp.163.com
# server_port: 465
# server_address: smtp.gmail.com
# server_port: 465
server_address: smtp.exmail.qq.com
server_port: 465
username: ${{ secrets.MAILUSERNAME }}
password: ${{ secrets.MAILPASSWORD }}
subject: GithubActions[Build_Monkey]( ${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }} )
to: ${{ secrets.MAIL_LIST }}
from: github.com/hhhaiai
body: Build_Monkey job ( ${{ github.job }} ) of ${{ github.repository }} completed successfully!
ignore_cert: true
priority: low
secure: true
attachments: ./monkey_${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}.tgz
#html_body: file://dev-sdk/build/reports/lint-results.html
#convert_markdown: true