spoon_google_apis_x86_64 #2926
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: spoon_google_apis_x86_64 | |
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: [ 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33 ] | |
target: [google_apis] | |
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 | |
cd ../ | |
bash ./copy.sh | |
echo "==============ls=================" | |
ls | |
rm -rf analysys-dev-sdk | |
wget https://repo1.maven.org/maven2/com/squareup/spoon/spoon-runner/1.7.1/spoon-runner-1.7.1-jar-with-dependencies.jar | |
echo "=================切换目录后查看当前目录=============" | |
pwd | |
ls | |
./replace.sh | |
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/ | |
./gradlew build || true | |
echo "=================编译完成查看目录=============" | |
pwd | |
ls | |
brew install coreutils | |
- name: cat | |
shell: bash | |
continue-on-error: true | |
run: | | |
echo "=================单纯查看目录=============" | |
pwd | |
ls | |
- name: run spoon tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.target }} | |
arch: ${{ matrix.arch }} | |
profile: Nexus 6 | |
# cores: 4 | |
# ram-size: 4096M | |
# sdcard-path-or-size: 1000M | |
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: | | |
gtimeout 30m ./gradlew :dev-sdk:connectedAndroidTest || true | |
echo "=================查看当前目录=============" | |
ls | |
export PATH=$PATH:${ANDROID_HOME}/emulator:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/build-tools/30.0.3:${ANDROID_HOME}/build-tools/30.0.3/lld-bin:${ANDROID_HOME}/ndk/23.0.7599858 | |
gtimeout 30m java -jar spoon-runner-1.7.1-jar-with-dependencies.jar --test-apk ./dev-sdk/build/outputs/apk/androidTest/debug/dev-sdk-debug-androidTest.apk --apk ./appdemo/build/outputs/apk/debug/appdemo-debug.apk --output ./spoon/ | |
echo "==============run spoon over===============" | |
tar -zcvf spoon-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}.tgz ./spoon/ | |
tar -zcvf ut_${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}.tgz dev-sdk/build/reports/ || true | |
echo "==============tar spoon over. ls===============" | |
echo "${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }} 运行完毕。。。。。。。。。" | |
rm -rf ~/.android/avd/ | |
- name: ypload spoon | |
shell: bash | |
continue-on-error: true | |
run: | | |
echo "${{github.repository_owner}} will upload files" | |
ls | |
####################################################################################################### | |
######################################## upload files ################################################# | |
####################################################################################################### | |
file_name=spoon-${{ 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: spoon ${{ github.repository }} Job ${{ github.job }}, created by ${{ github.workflow }} " -commit-auther "GitHubAction" -commit-email "sanbo.xyz@gmail.com" | |
- name: ypload ut | |
shell: bash | |
continue-on-error: true | |
run: | | |
echo "${{github.repository_owner}} will upload files" | |
ls | |
####################################################################################################### | |
######################################## upload files ################################################# | |
####################################################################################################### | |
file_name=ut_${{ 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: spoon ${{ 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[spoon]( ${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }} ) | |
to: ${{ secrets.MAIL_LIST }} | |
from: github.com/hhhaiai | |
body: spoon job ( ${{ github.job }} ) of ${{ github.repository }} completed successfully! | |
ignore_cert: true | |
priority: low | |
secure: true | |
attachments: ./ut_${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}.tgz, ./spoon-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}.tgz | |
#html_body: file://dev-sdk/build/reports/lint-results.html | |
#convert_markdown: true |