47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
name: lint
|
|
|
|
on: [push, pull_request]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python 3.7
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install pre-commit hook
|
|
run: |
|
|
pip install pre-commit
|
|
pre-commit install
|
|
- name: Linting
|
|
run: pre-commit run --all-files
|
|
- name: Format c/cuda codes with clang-format
|
|
uses: DoozyX/clang-format-lint-action@v0.11
|
|
with:
|
|
source: csrc
|
|
extensions: h,c,cpp,hpp,cu,cuh
|
|
style: file
|
|
- name: Check index.rst
|
|
run: |
|
|
python3 .github/scripts/check_index_rst.py docs/en/index.rst
|
|
python3 .github/scripts/check_index_rst.py docs/zh_cn/index.rst
|
|
- name: Check doc link
|
|
run: |
|
|
python3 .github/scripts/doc_link_checker.py --target docs/zh_cn
|
|
python3 .github/scripts/doc_link_checker.py --target README_zh-CN.md
|
|
python3 .github/scripts/doc_link_checker.py --target docs/en
|
|
python3 .github/scripts/doc_link_checker.py --target README.md
|
|
- name: Check docstring coverage
|
|
run: |
|
|
pip install interrogate
|
|
interrogate -v --ignore-init-method --ignore-module --ignore-private --ignore-nested-functions --ignore-nested-classes --fail-under 80 mmdeploy
|
|
- name: Check pylint score
|
|
run: |
|
|
pip install pylint
|
|
pylint mmdeploy
|