Skip to content

Commit 1ad8423

Browse files
authored
[CI] slice need set (#73433)
* test=document_fix
1 parent c037d11 commit 1ad8423

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ jobs:
110110
slice:
111111
name: Slice
112112
uses: ./.github/workflows/_Slice.yml
113-
needs: [build-docker, build]
113+
needs: [clone, build-docker, build]
114114
with:
115115
can-skip: ${{ needs.build.outputs.can-skip }}
116116
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
117+
slice-check: ${{ needs.clone.outputs.slice-check }}

.github/workflows/_Clone-linux.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
outputs:
1414
can-skip:
1515
value: ${{ jobs.clone.outputs.can-skip }}
16+
slice-check:
17+
value: ${{ jobs.clone.outputs.slice-check }}
1618

1719
permissions: read-all
1820

@@ -31,6 +33,7 @@ jobs:
3133
name: Clone Paddle
3234
outputs:
3335
can-skip: ${{ steps.check-bypass.outputs.can-skip }}
36+
slice-check: ${{ steps.check-execution.outputs.slice-check }}
3437

3538
if: github.repository_owner == 'PaddlePaddle'
3639
runs-on:
@@ -45,6 +48,7 @@ jobs:
4548
fetch-depth: 1000
4649

4750
- name: Merge PR to test branch
51+
id: check-execution
4852
run: |
4953
git config --unset http.https://github.com/.extraheader
5054
git submodule foreach --recursive sh -c "git config --local --unset-all 'http.https://github.com/.extraheader'"
@@ -58,6 +62,8 @@ jobs:
5862
git config user.name "PaddleCI"
5963
git config user.email "paddle_ci@example.com"
6064
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr
65+
git checkout pr
66+
source ${ci_scripts}/check_execution.sh
6167
git merge --no-ff pr
6268
git branch -d pr
6369
bash ${ci_scripts}/third_party_tag.sh

.github/workflows/_Slice.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
can-skip:
1010
type: string
1111
required: false
12+
slice-check:
13+
type: string
14+
required: false
1215

1316
env:
1417
PR_ID: ${{ github.event.pull_request.number }}
@@ -28,7 +31,7 @@ defaults:
2831
jobs:
2932
slice:
3033
name: Slice test
31-
if: ${{ inputs.can-skip != 'true' }}
34+
if: ${{ inputs.can-skip != 'true' && inputs.slice-check == 'true' }}
3235
runs-on:
3336
group: slice
3437
steps:

ci/check_execution.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
16+
if [[ "$COMMIT_MESSAGE" == *"slice-check"* ]]; then
17+
echo "slice-check=true"
18+
echo "slice-check=true" >> $GITHUB_OUTPUT
19+
fi
20+
git checkout test

0 commit comments

Comments
 (0)