Unverified Commit 20d4d202 authored by Zaida Zhou's avatar Zaida Zhou Committed by GitHub
Browse files

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
parent 87a6d92f
...@@ -20,13 +20,16 @@ def check_installation(): ...@@ -20,13 +20,16 @@ def check_installation():
# test mmcv-full with CPU ops # test mmcv-full with CPU ops
box_iou_rotated(boxes1, boxes2) box_iou_rotated(boxes1, boxes2)
print('CPU ops were compiled successfully.')
# test mmcv-full with both CPU and CUDA ops # test mmcv-full with both CPU and CUDA ops
if torch.cuda.is_available(): if torch.cuda.is_available():
boxes1 = boxes1.cuda() boxes1 = boxes1.cuda()
boxes2 = boxes2.cuda() boxes2 = boxes2.cuda()
box_iou_rotated(boxes1, boxes2) 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__': if __name__ == '__main__':
...@@ -37,4 +40,5 @@ if __name__ == '__main__': ...@@ -37,4 +40,5 @@ if __name__ == '__main__':
env_info_dict = collect_env() env_info_dict = collect_env()
env_info = '\n'.join([(f'{k}: {v}') for k, v in env_info_dict.items()]) env_info = '\n'.join([(f'{k}: {v}') for k, v in env_info_dict.items()])
dash_line = '-' * 60 + '\n' 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)
name: build 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: env:
MMCV_WITH_OPS: 1 MMCV_WITH_OPS: 1
jobs: 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: build_without_torch:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
strategy: strategy:
......
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment