11name : xpu_ci_test
2-
32on :
43 workflow_call :
54 inputs :
2221 required : true
2322 type : string
2423 default : " "
25-
2624jobs :
2725 run_xpu_cases :
2826 runs-on : [self-hosted, XPU-P800-8Cards]
@@ -38,49 +36,48 @@ jobs:
3836 formers_archive_url : ${{ inputs.PADDLEFORMERS_ARCHIVE_URL }}
3937 model_path : ${{ inputs.MODEL_PATH }}
4038 run : |
41- set -x
42- REPO="https://github.com/${{ github.repository }}.git"
43- FULL_REPO="${{ github.repository }}"
44- REPO_NAME="${FULL_REPO##*/}"
45- BASE_BRANCH="${{ github.base_ref }}"
46- # 由于ci机器网络问题 暂时屏蔽pull命令
47- # docker pull ${docker_image}
48- # Clean the repository directory before starting
49- docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
50- -e "REPO_NAME=${REPO_NAME}" \
51- ${docker_image} /bin/bash -c '
52- CLEAN_RETRIES=3
53- CLEAN_COUNT=0
54-
55- while [ $CLEAN_COUNT -lt $CLEAN_RETRIES ]; do
56- echo "Attempt $((CLEAN_COUNT+1)) to remove ${REPO_NAME}* ..."
57- rm -rf "${REPO_NAME}"* || true
58- sleep 2
59-
60- # Check if anything matching ${REPO_NAME}* still exists
61- if ! ls "${REPO_NAME}"* >/dev/null 2>&1; then
62- echo "All ${REPO_NAME}* removed successfully"
63- break
64- fi
39+ set -x
40+ REPO="https://github.com/${{ github.repository }}.git"
41+ FULL_REPO="${{ github.repository }}"
42+ REPO_NAME="${FULL_REPO##*/}"
43+ BASE_BRANCH="${{ github.base_ref }}"
44+ # 由于ci机器网络问题 暂时屏蔽pull命令
45+ # docker pull ${docker_image}
46+ # Clean the repository directory before starting
47+ docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
48+ -e "REPO_NAME=${REPO_NAME}" \
49+ ${docker_image} /bin/bash -c '
50+ CLEAN_RETRIES=3
51+ CLEAN_COUNT=0
6552
66- CLEAN_COUNT=$((CLEAN_COUNT + 1))
67- done
53+ while [ $CLEAN_COUNT -lt $CLEAN_RETRIES ]; do
54+ echo "Attempt $((CLEAN_COUNT+1)) to remove ${REPO_NAME}* ..."
55+ rm -rf "${REPO_NAME}"* || true
56+ sleep 2
6857
69- if ls " ${REPO_NAME}"* >/dev/null 2>&1; then
70- echo "ERROR: Failed to clean ${REPO_NAME}* after multiple attempts"
71- ls -ld " ${REPO_NAME}"*
72- exit 1
58+ # Check if anything matching ${REPO_NAME}* still exists
59+ if ! ls " ${REPO_NAME}"* >/dev/null 2>&1; then
60+ echo "All ${REPO_NAME}* removed successfully"
61+ break
7362 fi
74- '
7563
76- wget -q --no-proxy ${formers_archive_url}
77- tar -xf PaddleFormers.tar.gz
78- rm -rf PaddleFormers.tar.gz
79- cd PaddleFormers
80- git config --global user.name "PaddleFormersCI"
81- git config --global user.email "paddleformers_ci@example.com"
82- git log -n 3 --oneline
64+ CLEAN_COUNT=$((CLEAN_COUNT + 1))
65+ done
66+
67+ if ls "${REPO_NAME}"* >/dev/null 2>&1; then
68+ echo "ERROR: Failed to clean ${REPO_NAME}* after multiple attempts"
69+ ls -ld "${REPO_NAME}"*
70+ exit 1
71+ fi
72+ '
8373
74+ wget -q --no-proxy ${formers_archive_url}
75+ tar -xf PaddleFormers.tar.gz
76+ rm -rf PaddleFormers.tar.gz
77+ cd PaddleFormers
78+ git config --global user.name "PaddleFormersCI"
79+ git config --global user.email "paddleformers_ci@example.com"
80+ git log -n 3 --oneline
8481 - name : Run CI unittest
8582 env :
8683 docker_image : ${{ inputs.DOCKER_IMAGE }}
@@ -128,7 +125,9 @@ jobs:
128125 python -m pip uninstall librosa -y
129126 python -m pip install --pre paddlepaddle-xpu -i https://www.paddlepaddle.org.cn/packages/nightly/xpu-p800/
130127 echo "安装PaddleFormers..."
131- python -m pip install -e .
128+ python -m pip install uv
129+ uv build --wheel --package paddleformers --out-dir dist --clear -v
130+ python -m pip install dist/paddleformers-*.whl
132131 echo "============================安装测试依赖============================"
133132 python -m pip install pytest
134133 python -m pip install pytest-timeout
0 commit comments