diff --git a/.github/workflows/vllm_ascend_test.yaml b/.github/workflows/vllm_ascend_test.yaml index 540680dd2..73b4635b2 100644 --- a/.github/workflows/vllm_ascend_test.yaml +++ b/.github/workflows/vllm_ascend_test.yaml @@ -18,8 +18,22 @@ name: 'test' on: - schedule: - - cron: '0 23 * * *' + push: + # Enable merged test per commit + branches: + - 'main' + paths: + - '*.txt' + - '**/*.py' + - '.github/workflows/vllm_ascend_test.yaml' + - '!docs/**' + - 'pytest.ini' + - '!benchmarks/**' + - 'tools/mypy.sh' + - 'mypy.ini' + - '.github/workflows/*.ya?ml' + - '.github/workflows/actionlint.*' + - '.github/workflows/matchers/actionlint.json' pull_request: branches: - 'main' @@ -131,7 +145,7 @@ jobs: - name: Install packages run: | apt-get update -y - apt-get install -y python3-pip git vim wget net-tools gcc g++ cmake libnuma-dev + apt-get install -y python3-pip git vim wget net-tools gcc g++ cmake libnuma-dev curl gnupg2 - name: Checkout vllm-project/vllm repo uses: actions/checkout@v4 @@ -163,7 +177,17 @@ jobs: TORCH_DEVICE_BACKEND_AUTOLOAD: 0 run: | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib - pytest -sv tests/ut + pytest -sv --cov --cov-report=xml:unittests-coverage.xml tests/ut + + - name: Upload coverage to Codecov + if: ${{ matrix.vllm_version == 'main' }} + uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + flags: unittests + name: vllm-ascend + verbose: true e2e: needs: [lint] diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..933ced8a4 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,30 @@ +# +# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# This file is a part of the vllm-ascend project. +# + +coverage: + status: + # non-voting, new code must be fully tested + patch: + default: + target: 100% + # non-voting + informational: true + # non-voting + project: + default: + # non-voting + informational: true diff --git a/requirements-dev.txt b/requirements-dev.txt index c6f9241f9..7fb8786cc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,3 +11,4 @@ types-jsonschema xgrammar zmq types-psutil +pytest-cov