GitHubAction: triggle by commit 5d8bcf98fcabb34ee975675894083d9c83328… #2913
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: lint | |
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:')" | |
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 | |
- name: lint | |
shell: bash | |
continue-on-error: true | |
run: | | |
cd analysys-dev-sdk | |
rm -rf dev-sdk/src/main/java/com/analysys/plugin | |
bash ./replace.sh ||true | |
./gradlew build || true | |
./gradlew lint || true | |
#ls -R dev-sdk/build/>./lint_tree.txt | |
echo "${{github.repository_owner}} will upload files" | |
####################################################################################################### | |
######################################## upload files ################################################# | |
####################################################################################################### | |
file_name=dev-sdk/build/reports/lint-results.html | |
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/${dat}-$pn-${file_name}" | |
#upload_file_name="ci/${dat}-$pn-${file_name}" | |
chmod -R 777 * | |
echo "=================文件查看====================" | |
ls | |
echo "==dat== $dat" | |
echo "==dat== $upload_file_name" | |
# https://docs.github.com/cn/actions/learn-github-actions/contexts#github-context | |
echo "===========================">>${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} | |
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: lint ${{ github.repository }} Job ${{ github.job }}, created by ${{ github.workflow }} " -commit-auther "UploadGithubService" -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[lint]( ${{ github.job }} ) | |
to: ${{ secrets.MAIL_LIST }} | |
from: github.com/hhhaiai | |
body: lint job ( ${{ github.job }} ) of ${{ github.repository }} completed successfully! | |
ignore_cert: true | |
priority: low | |
secure: true | |
attachments: ./analysys-dev-sdk/dev-sdk/build/reports/lint-results.html | |
#html_body: file://dev-sdk/build/reports/lint-results.html | |
#convert_markdown: true | |