OneFlow Autoprof Discover #232
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: OneFlow Autoprof Discover | |
on: | |
schedule: | |
- cron: '10 1 * * *' | |
workflow_dispatch: | |
inputs: | |
upload_day_ago: | |
description: "upload_day_ago" | |
default: "1" | |
required: false | |
branch_name: | |
description: "branch_name" | |
default: "master" | |
required: false | |
jobs: | |
test_result: | |
name: Get Test Result | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout OneFlow Test | |
uses: actions/checkout@v2 | |
- name: Get Test result | |
id: get-test-result | |
env: | |
upload_day_ago: ${{ github.event.inputs.upload_day_ago }} | |
branch_name: ${{ github.event.inputs.branch_name }} | |
OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }} | |
OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }} | |
run: | | |
set -x | |
upload_day_ago=${upload_day_ago:-0} | |
branch_name=${branch_name:-"master"} | |
upload_issue_date=$(date -d "${upload_day_ago} day ago" +%Y%m%d) | |
curl http://gosspublic.alicdn.com/ossutil/1.6.19/ossutil64 -o $HOME/ossutil64 | |
chmod 755 $HOME/ossutil64 | |
$HOME/ossutil64 config -e oss-cn-beijing.aliyuncs.com -i ${OSS_ACCESS_KEY_ID} -k ${OSS_ACCESS_KEY_SECRET} -L EN -c $HOME/.ossutilconfig | |
$HOME/ossutil64 cp -r oss://oneflow-test/OneAutoTest/onebench/oneflow/autoprof/${upload_issue_date} ./ --include "oneflow_autoprof_discover_*.*" | |
if [ ! -d "/${upload_issue_date}" ]; then | |
echo "get_result=1" >> $GITHUB_ENV | |
issue_title=$(date "+%Y%m") | |
all_test_result_log=$(find ./${upload_issue_date} -name "oneflow_autoprof_discover_*.log") | |
all_test_result_csv=$(find ./${upload_issue_date} -name "oneflow_autoprof_discover_*.csv") | |
echo "OneFlow Autoprof Discover"$(date "+%Y年%m月%d日")" 测试结果如下: " > ./oneflow_autoprof_discover.md | |
echo '```' >> ./oneflow_autoprof_discover.md | |
echo $all_test_result_log >> ./oneflow_autoprof_discover.md | |
echo ' ' >> ./oneflow_autoprof_discover.md | |
echo $all_test_result_csv >> ./oneflow_autoprof_discover.md | |
echo '```' >> ./oneflow_autoprof_discover.md | |
sed -i "s+./${upload_issue_date}/+https://oneflow-test.oss-cn-beijing.aliyuncs.com/OneAutoTest/onebench/oneflow/autoprof/${upload_issue_date}/+g" ./oneflow_autoprof_discover.md | |
echo ' ' >> ./oneflow_autoprof_discover.md | |
# error | |
test_error_content=$(cat $all_test_result_log | grep 'ERROR:') | |
if [ -n "$test_error_content" ];then | |
echo '```' >> ./oneflow_autoprof_discover.md | |
echo "$test_error_content" >> ./oneflow_autoprof_discover.md | |
echo '```' >> ./oneflow_autoprof_discover.md | |
echo '@ouyangyu @daquexian @mosout ' >> ./oneflow_autoprof_discover.md | |
fi | |
all_test_result_md=./oneflow_autoprof_discover.md | |
echo "issue_title=${issue_title}_OneFlow_Autoprof_Discover_Report_On_${branch_name}" >> $GITHUB_ENV | |
echo "issue_comment_body=""${all_test_result_md}" >> $GITHUB_ENV | |
fi | |
- name: Create Issue Comment | |
if: env.get_result == '1' | |
uses: ./.github/actions/issue | |
with: | |
issue_title: ${{ env.issue_title }} | |
issue_comment_body: ${{ env.issue_comment_body }} |