|
| 1 | +# |
| 2 | +# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# This file is a part of the vllm-ascend project. |
| 16 | +# |
| 17 | + |
| 18 | +name: 'Doctest' |
| 19 | + |
| 20 | +on: |
| 21 | + workflow_dispatch: |
| 22 | + pull_request: |
| 23 | + branches: |
| 24 | + - 'main' |
| 25 | + - '*-dev' |
| 26 | + paths: |
| 27 | + # If we are changing the doctest we should do a PR test |
| 28 | + - '.github/workflows/vllm_ascend_doctest.yaml' |
| 29 | + - 'tests/doctest/**' |
| 30 | + schedule: |
| 31 | + # Runs every 4 hours |
| 32 | + - cron: '0 */4 * * *' |
| 33 | + |
| 34 | +# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly |
| 35 | +# declared as "shell: bash -el {0}" on steps that need to be properly activated. |
| 36 | +# It's used to activate ascend-toolkit environment variables. |
| 37 | +defaults: |
| 38 | + run: |
| 39 | + shell: bash -el {0} |
| 40 | + |
| 41 | +jobs: |
| 42 | + test: |
| 43 | + strategy: |
| 44 | + # Each version should be tested |
| 45 | + fail-fast: false |
| 46 | + matrix: |
| 47 | + vllm_verison: [main, v0.7.3-dev, main-openeuler, v0.7.3-dev-openeuler] |
| 48 | + name: vLLM Ascend test |
| 49 | + runs-on: linux-arm64-npu-1 |
| 50 | + container: |
| 51 | + image: m.daocloud.io/quay.io/ascend/vllm-ascend:${{ matrix.vllm_verison }} |
| 52 | + steps: |
| 53 | + - name: Check NPU/CANN and git info |
| 54 | + run: | |
| 55 | + echo "====> Prnint NPU/CANN info" |
| 56 | + npu-smi info |
| 57 | + cat /usr/local/Ascend/ascend-toolkit/latest/"$(uname -i)"-linux/ascend_toolkit_install.info |
| 58 | +
|
| 59 | + echo "====> Prnint vllm-ascend git info" |
| 60 | + cd /vllm-workspace/vllm-ascend |
| 61 | + git --no-pager log -1 || true |
| 62 | + echo "====> Prnint vllm git info" |
| 63 | + cd /vllm-workspace/vllm |
| 64 | + git --no-pager log -1 || true |
| 65 | +
|
| 66 | + - name: Config OS mirrors - Ubuntu |
| 67 | + if: ${{ !endsWith(matrix.vllm_verison, '-openeuler') }} |
| 68 | + run: | |
| 69 | + sed -i 's|ports.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list |
| 70 | + apt-get update -y |
| 71 | + apt install git curl -y |
| 72 | +
|
| 73 | + - name: Config OS mirrors - openEuler |
| 74 | + if: ${{ endsWith(matrix.vllm_verison, '-openeuler') }} |
| 75 | + run: | |
| 76 | + yum update -y |
| 77 | + yum install git curl -y |
| 78 | +
|
| 79 | + - name: Config pip mirrors |
| 80 | + run: | |
| 81 | + pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple |
| 82 | +
|
| 83 | + - name: Checkout vllm-project/vllm-ascend repo |
| 84 | + uses: actions/checkout@v4 |
| 85 | + |
| 86 | + - name: Run vllm-ascend/tests/e2e/run_doctests.sh |
| 87 | + run: | |
| 88 | + # PWD: /__w/vllm-ascend/vllm-ascend |
| 89 | + # Address old branch like v0.7.3: |
| 90 | + if [ ! -d /vllm-workspace/vllm-ascend/tests/e2e ]; then |
| 91 | + echo "Warning: the doctest path doesn't exists, copy now" |
| 92 | + cp -r tests/e2e /vllm-workspace/vllm-ascend/tests/ |
| 93 | + fi |
| 94 | +
|
| 95 | + # Simulate container to enter directory |
| 96 | + cd /workspace |
| 97 | +
|
| 98 | + # Run real test |
| 99 | + echo "Test:" |
| 100 | + /vllm-workspace/vllm-ascend/tests/e2e/run_doctests.sh |
0 commit comments