Skip to content

Commit

Permalink
[CINN]support skip coverage (PaddlePaddle#64452)
Browse files Browse the repository at this point in the history
* support skip coverage

* support skip coverage

* support skip coverage

* test

* Update shape_optimization_pass.cc
  • Loading branch information
risemeup1 authored and chen2016013 committed May 26, 2024
1 parent a4e1053 commit 5604e2d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/coverage/paddle_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ if [ "$COVERAGE_LINES_ASSERT" = "1" ] || [ "$PYTHON_COVERAGE_LINES_ASSERT" = "1"
echo "exit 9" > /tmp/paddle_coverage.result
if [ "${WITH_CINN}" == "ON" ]; then
echo "You must one RD(liuhongyu or lanxiang or zhenghuihuang or tianchao zhangliujie)to approval this PR."
exit 9
fi
exit 9
python ${PADDLE_ROOT}/tools/get_pr_title.py || NOT_CINN_PR=1
if [[ "${NOT_CINN_PR}" = "1" ]];then
exit 9
fi
echo "This PR belongs to the CINN direction, skip the coverage check in the PR-CI-Coverage pipeline."
fi
40 changes: 40 additions & 0 deletions tools/get_pr_title.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import json
import os
import sys

import requests

pr_id = os.getenv('GIT_PR_ID')
if not pr_id:
print('PREC No PR ID')
sys.exit(0)

response = requests.get(
f'https://api.github.com/repos/PaddlePaddle/Paddle/pulls/{pr_id}',
headers={'Accept': 'application/vnd.github.v3+json'},
)

data = json.loads(response.text)

title = data['title']

prefixes = ['【CINN】', '[CINN]', '[cinn]', '【cinn】']
if any(title.startswith(prefix) for prefix in prefixes):
print('The title starts with cinn')
else:
print('The title does not start with cinn')
sys.exit(1)

0 comments on commit 5604e2d

Please sign in to comment.