Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CINN]support skip coverage #64452

Merged
merged 6 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)