build_x86_64_google_apis_playstore #1993
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |