Skip to content

Commit

Permalink
Skip CI when some specific files were changed (#1533)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
zhouzaida authored Nov 29, 2021
1 parent 87a6d92 commit 20d4d20
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 24 deletions.
8 changes: 6 additions & 2 deletions .dev_scripts/check_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand All @@ -37,4 +40,5 @@ def check_installation():
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)
40 changes: 18 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 20d4d20

Please sign in to comment.