name: pre-commit on: workflow_call: inputs: vllm: required: true type: string permissions: contents: read jobs: pre-commit: runs-on: linux-amd64-cpu-16-hk container: # Build it from https://github.com/nv-action/vllm-benchmarks/blob/main/Dockerfile image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-cpu env: GOPROXY: https://goproxy.io,direct GITHUB_WORKSPACE: /__w/vllm-ascend/vllm-ascend steps: - name: Checkout vllm-project/vllm-ascend repo uses: actions/checkout@v6 # With problem matchers in a container, the output of $GITHUB_WORKSPACE and ${{ github.workspace }} are different. # So we will just copy it into the path ${{ github.workspace }}. see https://github.com/actions/runner/issues/2058 - name: cp problem matchers run: | cp .github/workflows/matchers/actionlint.json "$RUNNER_TEMP/actionlint.json" cp .github/workflows/matchers/mypy.json "$RUNNER_TEMP/mypy.json" - run: echo "::add-matcher::$RUNNER_TEMP/actionlint.json" - run: echo "::add-matcher::$RUNNER_TEMP/mypy.json" - name: Checkout vllm-project/vllm repo uses: actions/checkout@v6 with: repository: vllm-project/vllm path: ./vllm-empty ref: ${{ inputs.vllm }} - name: Install vllm working-directory: vllm-empty run: | VLLM_TARGET_DEVICE=empty python3 -m pip install . --extra-index https://download.pytorch.org/whl/cpu/ - name: Install vllm-ascend dev run: | git config --global --add safe.directory /__w/vllm-ascend/vllm-ascend pip install -r requirements-dev.txt --extra-index-url https://download.pytorch.org/whl/cpu - name: Run pre-commit env: PRE_COMMIT_COLOR: always FORCE_COLOR: "1" TERM: xterm-256color SHELLCHECK_OPTS: "--exclude=SC2046,SC2006,SC2086" # Exclude SC2046, SC2006, SC2086 for actionlint run: | pre-commit run --all-files --hook-stage manual