Skip to content

Commit 9b7badd

Browse files
authored
[CI] single coverage workflow (#72586)
* test=document_fix coverage single * test=document_fix concurrency * test=document_fix ci del coverage * test=document_fix clone input * test=document_fix del old bypass * test=document_fix rerun * test=document_fix add old bypass * test=document_fix add old bypass * test=document_fix * test=document_fix rerun * test=document_fix rerun * test=document_fix add docker * test=document_fix bos dir
1 parent ea1665a commit 9b7badd

File tree

7 files changed

+91
-12
lines changed

7 files changed

+91
-12
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ jobs:
4444
with:
4545
docker_inference_image: ${{ needs.build-docker.outputs.docker_inference_image }}
4646

47-
coverage:
48-
name: Coverage
49-
uses: ./.github/workflows/_Coverage.yml
50-
needs: clone
51-
5247
cpu:
5348
name: Linux-CPU
5449
uses: ./.github/workflows/_Linux-CPU.yml

.github/workflows/_Coverage.yml renamed to .github/workflows/Coverage.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
name: Coverage
22

33
on:
4-
workflow_call:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches: [develop, release/**]
7+
8+
permissions: read-all
9+
10+
concurrency:
11+
group: ${{ github.event.pull_request.number }}-${{ github.workflow }}
12+
cancel-in-progress: true
513

614
env:
715
Dockerfile: Dockerfile.cuda117_cudnn8_gcc82_ubuntu18_coverage
@@ -22,8 +30,24 @@ defaults:
2230
shell: bash
2331

2432
jobs:
33+
clone:
34+
name: Coverage clone
35+
uses: ./.github/workflows/_Clone-linux.yml
36+
with:
37+
workflow-name: 'coverage'
38+
bos_dir: Paddle-coverage
39+
40+
build-docker:
41+
name: Coverage build docker
42+
needs: clone
43+
uses: ./.github/workflows/docker.yml
44+
with:
45+
bos_dir: Paddle-coverage
46+
2547
build:
2648
name: Coverage build
49+
needs: [clone, build-docker]
50+
if: needs.clone.outputs.can-skip != 'true'
2751
runs-on:
2852
group: GZ_BD-CPU
2953
outputs:
@@ -34,7 +58,7 @@ jobs:
3458
run: |
3559
set -e
3660
echo "Downloading Paddle.tar.gz"
37-
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/Paddle/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
61+
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/Paddle-coverage/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
3862
echo "Extracting Paddle.tar.gz"
3963
tar xf Paddle.tar.gz --strip-components=1
4064
rm Paddle.tar.gz
@@ -84,6 +108,8 @@ jobs:
84108
run: |
85109
container_name=${TASK}-build-$(date +%Y%m%d-%H%M%S)
86110
echo "container_name=${container_name}" >> ${{ github.env }}
111+
docker_image=${{ needs.build-docker.outputs.docker_coverage_image }}
112+
docker pull $docker_image
87113
docker run -d -t --name ${container_name} \
88114
-v "/home/data/cfs:/home/data/cfs" \
89115
-v "/home/data/cfs/.cache:/root/.cache" \

.github/workflows/_Clone-linux.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ name: Clone-linux
22

33
on:
44
workflow_call:
5+
inputs:
6+
workflow-name:
7+
type: string
8+
required: false
9+
bos_dir:
10+
type: string
11+
required: false
12+
default: 'Paddle'
13+
outputs:
14+
can-skip:
15+
value: ${{ jobs.Clone.outputs.can-skip }}
516

617
permissions: read-all
718

@@ -18,6 +29,9 @@ jobs:
1829
Clone:
1930
# Don't run on forked repos.
2031
name: Clone Paddle
32+
outputs:
33+
can-skip: ${{ steps.check-bypass.outputs.can-skip }}
34+
2135
if: github.repository_owner == 'PaddlePaddle'
2236
runs-on:
2337
group: HK-Clone
@@ -48,6 +62,13 @@ jobs:
4862
git branch -d pr
4963
bash ${ci_scripts}/third_party_tag.sh
5064
65+
- name: Check bypass
66+
id: check-bypass
67+
uses: ./.github/actions/check-bypass
68+
with:
69+
github-token: ${{ secrets.GITHUB_TOKEN }}
70+
workflow-name: ${{ inputs.workflow-name }}
71+
5172
- name: Download bos client
5273
env:
5374
home_path: "/home/paddle/actions-runner/"
@@ -70,7 +91,7 @@ jobs:
7091
echo "::group::Install bce-python-sdk"
7192
python -m pip install bce-python-sdk==0.8.74
7293
echo "::endgroup::"
73-
python ${bos_file} Paddle.tar.gz paddle-github-action/PR/Paddle/${PR_ID}/${COMMIT_ID}
94+
python ${bos_file} Paddle.tar.gz paddle-github-action/PR/${{ inputs.bos_dir }}/${PR_ID}/${COMMIT_ID}
7495
rm Paddle.tar.gz
7596
cd -
7697
git switch ${{ github.event.pull_request.base.ref }}

.github/workflows/docker.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
on:
22
workflow_call:
3+
inputs:
4+
bos_dir:
5+
required: false
6+
type: string
7+
default: "Paddle"
38
outputs:
49
docker_cpu_image:
510
description: "Generate images for all CI usage"
@@ -45,7 +50,7 @@ jobs:
4550
docker_distribute_file: Dockerfile.cuda123_cudnn9_gcc122_ubuntu20
4651
run: |
4752
set -x
48-
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/Paddle/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
53+
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/${{ inputs.bos_dir }}/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
4954
tar xf Paddle.tar.gz --strip-components=1
5055
rm Paddle.tar.gz
5156
cd tools/dockerfile

.github/workflows/re-run.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,24 @@ jobs:
120120
JOB_NAME: 'PR-CI-Inference / Test'
121121

122122
- name: Rerun coverage
123-
if: ${{ contains(env.comment_body, 'coverage') && !contains(env.comment_body, 'test') }}
123+
if: ${{ contains(env.comment_body, 'coverage') && !contains(env.comment_body, 'build') && !contains(env.comment_body, 'test') }}
124124
uses: ./.github/actions/rerun-workflow
125125
with:
126126
PR_ID: ${{ github.event.issue.number }}
127127
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128128
OWNER: ${{ github.repository_owner }}
129129
REPO: ${{ github.event.repository.name }}
130-
JOB_NAME: 'Coverage / Coverage build'
130+
JOB_NAME: 'Coverage clone'
131+
132+
- name: Rerun coverage build
133+
if: ${{ contains(env.comment_body, 'coverage') && contains(env.comment_body, 'build') && !contains(env.comment_body, 'test') }}
134+
uses: ./.github/actions/rerun-workflow
135+
with:
136+
PR_ID: ${{ github.event.issue.number }}
137+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138+
OWNER: ${{ github.repository_owner }}
139+
REPO: ${{ github.event.repository.name }}
140+
JOB_NAME: 'Coverage build'
131141

132142
- name: Rerun coverage test
133143
if: ${{ contains(env.comment_body, 'coverage') && contains(env.comment_body, 'test') }}
@@ -137,7 +147,7 @@ jobs:
137147
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138148
OWNER: ${{ github.repository_owner }}
139149
REPO: ${{ github.event.repository.name }}
140-
JOB_NAME: 'Coverage / Coverage test'
150+
JOB_NAME: 'Coverage test'
141151

142152
- name: Rerun XPU
143153
if: ${{ contains(env.comment_body, 'xpu') && !contains(env.comment_body, 'build') && !contains(env.comment_body, 'test') }}
@@ -168,3 +178,23 @@ jobs:
168178
OWNER: ${{ github.repository_owner }}
169179
REPO: ${{ github.event.repository.name }}
170180
JOB_NAME: 'Linux-XPU / Test'
181+
182+
- name: Rerun distribute-stable build
183+
if: ${{ contains(env.comment_body, 'distribute') && !contains(env.comment_body, 'test') }}
184+
uses: ./.github/actions/rerun-workflow
185+
with:
186+
PR_ID: ${{ github.event.issue.number }}
187+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188+
OWNER: ${{ github.repository_owner }}
189+
REPO: ${{ github.event.repository.name }}
190+
JOB_NAME: 'Distribute-stable / Build'
191+
192+
- name: Rerun distribute-stable test
193+
if: ${{ contains(env.comment_body, 'distribute') && contains(env.comment_body, 'test') }}
194+
uses: ./.github/actions/rerun-workflow
195+
with:
196+
PR_ID: ${{ github.event.issue.number }}
197+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198+
OWNER: ${{ github.repository_owner }}
199+
REPO: ${{ github.event.repository.name }}
200+
JOB_NAME: 'Distribute-stable / Test'

ci/check_added_ut.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
set +e
16+
unset GREP_OPTIONS
1617

1718
SYSTEM=`uname -s`
1819
if [ -z ${BRANCH} ]; then

ci/coverage_build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ echo "/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/lib/x86_64-linux-gnu:\$
3232
echo "export PATH=/usr/local/bin:\\" >> ~/.bashrc
3333
echo "\${PATH}" >> ~/.bashrc
3434
source ~/.bashrc
35+
unset GREP_OPTIONS
3536

3637
check_diff_file_for_coverage
3738

0 commit comments

Comments
 (0)