Skip CI when some specific files were changed (#1533)

* [Docs] Skip CI when some specific files were changed

* remove a unnecessary environment in lint.yml

* Use paths-ignore to ignore paths instead of paths

* fix typo
pull/1535/head
Zaida Zhou 2021-11-29 22:06:05 +08:00 committed by GitHub
parent 87a6d92f50
commit 20d4d20284
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 24 deletions

View File

@ -20,13 +20,16 @@ def check_installation():
# test mmcv-full with CPU ops
box_iou_rotated(boxes1, boxes2)
print('CPU ops were compiled successfully.')
# test mmcv-full with both CPU and CUDA ops
if torch.cuda.is_available():
boxes1 = boxes1.cuda()
boxes2 = boxes2.cuda()
box_iou_rotated(boxes1, boxes2)
print('CUDA ops were compiled successfully.')
else:
print('No CUDA runtime is found, skipping the checking of CUDA ops.')
if __name__ == '__main__':
@ -37,4 +40,5 @@ if __name__ == '__main__':
env_info_dict = collect_env()
env_info = '\n'.join([(f'{k}: {v}') for k, v in env_info_dict.items()])
dash_line = '-' * 60 + '\n'
print('Environment info:\n' + dash_line + env_info + '\n' + dash_line)
print('Environment information:')
print(dash_line + env_info + '\n' + dash_line)

View File

@ -1,32 +1,28 @@
name: build
on: [push, pull_request]
on:
push:
paths-ignore:
- 'README.md'
- 'README_zh-CN.md'
- 'docs/**'
- 'docs_zh-CN/**'
- 'examples/**'
- '.dev_scripts/**'
pull_request:
paths-ignore:
- 'README.md'
- 'README_zh-CN.md'
- 'docs/**'
- 'docs_zh-CN/**'
- 'examples/**'
- '.dev_scripts/**'
env:
MMCV_WITH_OPS: 1
jobs:
lint:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
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: mmcv/ops/csrc
extensions: h,c,cpp,hpp,cu,cuh
style: google
build_without_torch:
runs-on: ubuntu-18.04
strategy:

25
.github/workflows/lint.yml vendored 100644
View File

@ -0,0 +1,25 @@
name: lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
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: mmcv/ops/csrc
extensions: h,c,cpp,hpp,cu,cuh
style: google