|
| 1 | +# |
| 2 | +# Adapted from vllm-project/vllm/blob/main/.github |
| 3 | +# Copyright 2023 The vLLM team. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +name: mypy |
| 19 | + |
| 20 | +on: |
| 21 | + # Trigger the workflow on push or pull request, |
| 22 | + # but only for the main branch |
| 23 | + push: |
| 24 | + branches: |
| 25 | + - "main" |
| 26 | + paths: |
| 27 | + - '**/*.py' |
| 28 | + - '.github/workflows/mypy.yaml' |
| 29 | + - 'tools/mypy.sh' |
| 30 | + pull_request: |
| 31 | + branches: |
| 32 | + - "main" |
| 33 | + # This workflow is only relevant when one of the following files changes. |
| 34 | + # However, we have github configured to expect and require this workflow |
| 35 | + # to run and pass before github with auto-merge a pull request. Until github |
| 36 | + # allows more flexible auto-merge policy, we can just run this on every PR. |
| 37 | + # It doesn't take that long to run, anyway. |
| 38 | + paths: |
| 39 | + - '**/*.py' |
| 40 | + - '.github/workflows/mypy.yaml' |
| 41 | + - 'tools/mypy.sh' |
| 42 | + |
| 43 | +jobs: |
| 44 | + mypy: |
| 45 | + runs-on: ubuntu-latest |
| 46 | + strategy: |
| 47 | + matrix: |
| 48 | + python-version: ["3.9", "3.10", "3.11", "3.12"] |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 51 | + - name: Set up Python ${{ matrix.python-version }} |
| 52 | + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 |
| 53 | + with: |
| 54 | + python-version: ${{ matrix.python-version }} |
| 55 | + - name: Install dependencies |
| 56 | + run: | |
| 57 | + pip install -r requirements-dev.txt |
| 58 | +
|
| 59 | + - name: Checkout vllm-project/vllm repo |
| 60 | + uses: actions/checkout@v4 |
| 61 | + with: |
| 62 | + repository: vllm-project/vllm |
| 63 | + path: vllm-empty |
| 64 | + |
| 65 | + - name: Install vllm-project/vllm from source |
| 66 | + working-directory: vllm-empty |
| 67 | + run: | |
| 68 | + pip install -r requirements-build.txt --extra-index-url https://download.pytorch.org/whl/cpu |
| 69 | + VLLM_TARGET_DEVICE=empty pip install . |
| 70 | +
|
| 71 | + - name: Mypy |
| 72 | + run: | |
| 73 | + echo "::add-matcher::.github/workflows/matchers/mypy.json" |
| 74 | + tools/mypy.sh 1 ${{ matrix.python-version }} |
0 commit comments