|
31 | 31 | - '!docs/**' |
32 | 32 | - 'pytest.ini' |
33 | 33 | - '!benchmarks/**' |
| 34 | + - 'tools/mypy.sh' |
| 35 | + - 'mypy.ini' |
| 36 | + |
34 | 37 | # Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly |
35 | 38 | # declared as "shell: bash -el {0}" on steps that need to be properly activated. |
36 | 39 | # It's used to activate ascend-toolkit environment variables. |
37 | 40 | defaults: |
38 | 41 | run: |
39 | 42 | shell: bash -el {0} |
40 | 43 |
|
| 44 | +jobs: |
| 45 | + codespell: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + strategy: |
| 48 | + matrix: |
| 49 | + python-version: ["3.12"] |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 52 | + - name: Set up Python ${{ matrix.python-version }} |
| 53 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 54 | + with: |
| 55 | + python-version: ${{ matrix.python-version }} |
| 56 | + - name: Install dependencies |
| 57 | + run: | |
| 58 | + python -m pip install --upgrade pip |
| 59 | + pip install -r requirements-lint.txt |
| 60 | + - name: Run codespell check |
| 61 | + run: | |
| 62 | + CODESPELL_EXCLUDES=('--skip' 'tests/prompts/**,./benchmarks/sonnet.txt,*tests/lora/data/**,build/**,./vllm_ascend.egg-info/**') |
| 63 | + CODESPELL_IGNORE_WORDS=('-L' 'CANN,cann,NNAL,nnal,ASCEND,ascend,EnQue,CopyIn') |
| 64 | +
|
| 65 | + codespell --toml pyproject.toml "${CODESPELL_EXCLUDES[@]}" "${CODESPELL_IGNORE_WORDS[@]}" |
| 66 | +
|
| 67 | +jobs: |
| 68 | + ruff: |
| 69 | + runs-on: ubuntu-latest |
| 70 | + strategy: |
| 71 | + matrix: |
| 72 | + python-version: ["3.12"] |
| 73 | + steps: |
| 74 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 75 | + - name: Set up Python ${{ matrix.python-version }} |
| 76 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 77 | + with: |
| 78 | + python-version: ${{ matrix.python-version }} |
| 79 | + - name: Install dependencies |
| 80 | + run: | |
| 81 | + python -m pip install --upgrade pip |
| 82 | + pip install -r requirements-lint.txt |
| 83 | + - name: Analysing the code with ruff |
| 84 | + run: | |
| 85 | + echo "::add-matcher::.github/workflows/matchers/ruff.json" |
| 86 | + ruff check --output-format github . |
| 87 | + - name: Run isort |
| 88 | + run: | |
| 89 | + isort . --check-only |
| 90 | +
|
| 91 | +jobs: |
| 92 | + yapf: |
| 93 | + runs-on: ubuntu-latest |
| 94 | + strategy: |
| 95 | + matrix: |
| 96 | + python-version: ["3.12"] |
| 97 | + steps: |
| 98 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 99 | + - name: Set up Python ${{ matrix.python-version }} |
| 100 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 101 | + with: |
| 102 | + python-version: ${{ matrix.python-version }} |
| 103 | + - name: Install dependencies |
| 104 | + run: | |
| 105 | + python -m pip install --upgrade pip |
| 106 | + pip install toml |
| 107 | + pip install yapf==0.32.0 |
| 108 | + - name: Running yapf |
| 109 | + run: | |
| 110 | + yapf --diff --recursive . |
| 111 | +
|
| 112 | +jobs: |
| 113 | + mypy: |
| 114 | + runs-on: ubuntu-latest |
| 115 | + strategy: |
| 116 | + matrix: |
| 117 | + # TODO(yikun): Add 3.12 back when torch-npu support 3.12 |
| 118 | + python-version: ["3.9", "3.10", "3.11"] |
| 119 | + steps: |
| 120 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 121 | + - name: Set up Python ${{ matrix.python-version }} |
| 122 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 123 | + with: |
| 124 | + python-version: ${{ matrix.python-version }} |
| 125 | + - name: Install dependencies |
| 126 | + run: | |
| 127 | + pip install -r requirements-dev.txt --extra-index-url https://download.pytorch.org/whl/cpu |
| 128 | +
|
| 129 | + - name: Checkout vllm-project/vllm repo |
| 130 | + uses: actions/checkout@v4 |
| 131 | + with: |
| 132 | + repository: vllm-project/vllm |
| 133 | + path: vllm-empty |
| 134 | + |
| 135 | + - name: Install vllm-project/vllm from source |
| 136 | + working-directory: vllm-empty |
| 137 | + run: | |
| 138 | + pip install -r requirements/build.txt --extra-index-url https://download.pytorch.org/whl/cpu |
| 139 | + VLLM_TARGET_DEVICE=empty pip install . |
| 140 | +
|
| 141 | + - name: Mypy |
| 142 | + run: | |
| 143 | + echo "::add-matcher::.github/workflows/matchers/mypy.json" |
| 144 | + tools/mypy.sh 1 ${{ matrix.python-version }} |
| 145 | +
|
41 | 146 | jobs: |
42 | 147 | test: |
| 148 | + needs: [codespell, ruff, yapf, mypy] |
| 149 | + if: ${{ needs.codespell.result == 'success' && needs.ruff.result == 'success' && needs.yapf.result == 'success' && needs.mypy.result == 'success' }} |
43 | 150 | strategy: |
44 | 151 | max-parallel: 2 |
45 | 152 | matrix: |
|
0 commit comments