Skip to content

Commit 52504b7

Browse files
authored
[CI]Add codecov (#2528)
1 parent e39fe05 commit 52504b7

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/ce-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
work_dir: ${{ github.workspace }}
3535
FLAGS_dynamic_static_unified_comm: "True"
3636
python_version: "3.10"
37-
paddle: https://paddle-qa.bj.bcebos.com/paddle-pipeline/Develop-GpuSome-LinuxCentos-Gcc82-Cuda118-Cudnn86-Trt85-Py310-CENN-Compile/latest/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
37+
paddle: https://paddle-qa.bj.bcebos.com/paddle-pipeline/Develop-GpuSome-LinuxCentos-Gcc82-Cuda118-Cudnn86-Trt85-Py310-CINN-Compile/latest/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
3838
run: |
3939
container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
4040
echo "container_name=${container_name}" >> "$GITHUB_ENV"

.github/workflows/unittest-cpu.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,45 @@ jobs:
9898
echo "finished"
9999
'
100100
101+
- name: Upload Cov-report
102+
if: always()
103+
env:
104+
home_path: ${{ github.workspace }}/../../..
105+
bos_file: ${{ github.workspace }}/../../../bos/BosClient.py
106+
allure_file: ${{ github.workspace }}/../../../allure-2.19.0/bin/allure
107+
run: |
108+
docker exec -t $container_name /bin/bash -c '
109+
if [ ! -f "${{ env.bos_file }}" ]; then
110+
wget -q --no-proxy -O ${{ env.home_path }}/bos_new.tar.gz https://xly-devops.bj.bcebos.com/home/bos_new.tar.gz --no-check-certificate
111+
mkdir ${{ env.home_path }}/bos
112+
tar xf ${{ env.home_path }}/bos_new.tar.gz -C ${{ env.home_path }}/bos
113+
fi
114+
if [ ! -f "${{ env.allure_file }}" ]; then
115+
wget -q --no-proxy -O ${{ env.home_path }}/allure-2.19.0.zip https://xly-devops.bj.bcebos.com/tools/allure-2.19.0.zip --no-check-certificate
116+
unzip -q ${{ env.home_path }}/allure-2.19.0.zip
117+
fi
118+
cd /workspace/PaddleFormers
119+
python ${{ env.bos_file }} coverage.xml paddle-github-action/PR/PaddleFormers/unittest-cpu/${PR_ID}/${COMMIT_ID}/logs
120+
echo "cov-report: https://paddle-github-action.bj.bcebos.com/PR/PaddleFormers/unittest-cpu/${PR_ID}/${COMMIT_ID}/logs/coverage.xml"
121+
'
101122
102123
- name: Terminate And Delete the Container
103124
if: always()
104125
run: |
105126
docker rm -f $container_name 2>/dev/null || true
127+
128+
upload-coverage:
129+
name: upload-coverage
130+
needs: [unittest-cpu-ci]
131+
if: always()
132+
runs-on: ubuntu-latest
133+
steps:
134+
- name: Wget Cov-report
135+
run: |
136+
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/PaddleFormers/unittest-cpu/${PR_ID}/${COMMIT_ID}/logs/coverage.xml --no-check-certificate
137+
138+
- name: Upload Cov-report
139+
uses: codecov/codecov-action@v4
140+
env:
141+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
142+
if-no-files-found: ignore

0 commit comments

Comments
 (0)