Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip CI when some specific files were changed #1533

Merged
merged 4 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: build
zhouzaida marked this conversation as resolved.
Show resolved Hide resolved
ZwwWayne marked this conversation as resolved.
Show resolved Hide resolved

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