This repository has been archived by the owner on Feb 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* do lint in CI Signed-off-by: MengqingCao <cmq0113@163.com>
- Loading branch information
1 parent
6b38777
commit 90f5757
Showing
8 changed files
with
225 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
pull_request_rules: | ||
- name: label-documentation | ||
description: Automatically apply documentation label | ||
conditions: | ||
- or: | ||
- files~=^[^/]+\.md$ | ||
- files~=^docs/ | ||
actions: | ||
label: | ||
add: | ||
- documentation | ||
|
||
- name: label-ci-build | ||
description: Automatically apply ci/build label | ||
conditions: | ||
- or: | ||
- files~=^\.github/ | ||
- files~=^Dockerfile | ||
- files~=^requirements.*\.txt | ||
- files=setup.py | ||
actions: | ||
label: | ||
add: | ||
- ci/build | ||
|
||
|
||
- name: ping author on conflicts and add 'needs-rebase' label | ||
conditions: | ||
- conflict | ||
- -closed | ||
actions: | ||
label: | ||
add: | ||
- needs-rebase | ||
comment: | ||
message: | | ||
This pull request has merge conflicts that must be resolved before it can be | ||
merged. Please rebase the PR, @{{author}}. | ||
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork | ||
- name: remove 'needs-rebase' label when conflict is resolved | ||
conditions: | ||
- -conflict | ||
- -closed | ||
actions: | ||
label: | ||
remove: | ||
- needs-rebase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: mypy | ||
|
||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**/*.py' | ||
- '.github/workflows/mypy.yaml' | ||
- 'tools/mypy.sh' | ||
pull_request: | ||
branches: | ||
- main | ||
# This workflow is only relevant when one of the following files changes. | ||
# However, we have github configured to expect and require this workflow | ||
# to run and pass before github with auto-merge a pull request. Until github | ||
# allows more flexible auto-merge policy, we can just run this on every PR. | ||
# It doesn't take that long to run, anyway. | ||
paths: | ||
- '**/*.py' | ||
- '.github/workflows/mypy.yaml' | ||
- 'tools/mypy.sh' | ||
|
||
jobs: | ||
mypy: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install mypy==1.11.1 | ||
pip install types-setuptools | ||
pip install types-PyYAML | ||
pip install types-requests | ||
pip install types-setuptools | ||
sudo apt-get update | ||
sudo apt-get install -y git gcc-12 g++-12 libnuma-dev | ||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 --slave /usr/bin/g++ g++ /usr/bin/g++-12 | ||
pip install cmake>=3.26 wheel packaging ninja "setuptools-scm>=8" numpy | ||
- name: Download and Install vllm cpu | ||
# TODO (cmq): clone vllm-project/vllm:main instead of cosdt/vllm:apply_plugin | ||
run: | | ||
git clone https://github.com/cosdt/vllm -b apply_plugin | ||
cd vllm | ||
pip install -r requirements-cpu.txt --extra-index-url https://download.pytorch.org/whl/cpu | ||
VLLM_TARGET_DEVICE=cpu python setup.py install | ||
- name: Mypy | ||
run: | | ||
echo "::add-matcher::.github/workflows/matchers/mypy.json" | ||
tools/mypy.sh 1 ${{ matrix.python-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: ruff | ||
|
||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**/*.py" | ||
- requirements-lint.txt | ||
- .github/workflows/matchers/ruff.json | ||
- .github/workflows/ruff.yml | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.12"] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements-lint.txt | ||
- name: Analysing the code with ruff | ||
run: | | ||
echo "::add-matcher::.github/workflows/matchers/ruff.json" | ||
ruff check --output-format github . | ||
- name: Run isort | ||
run: | | ||
isort . --check-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Lint shell scripts | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- '**/*.sh' | ||
- '.github/workflows/shellcheck.yml' | ||
pull_request: | ||
branches: | ||
- "main" | ||
paths: | ||
- '**/*.sh' | ||
- '.github/workflows/shellcheck.yml' | ||
|
||
env: | ||
LC_ALL: en_US.UTF-8 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
shellcheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Check shell scripts" | ||
run: | | ||
tools/shellcheck.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: yapf | ||
|
||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**/*.py" | ||
- .github/workflows/yapf.yml | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "**/*.py" | ||
- .github/workflows/yapf.yml | ||
|
||
jobs: | ||
yapf: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.12"] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install yapf==0.32.0 | ||
- name: Running yapf | ||
run: | | ||
yapf --diff --recursive . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters