Skip to content

Commit

Permalink
[Enhance] Skip CI when some specific files were changed (#640)
Browse files Browse the repository at this point in the history
* add lint.yml and modify build.yml

* update

* update lint.yml
  • Loading branch information
ckkelvinchan authored Dec 4, 2021
1 parent ba9d8e5 commit 6afc390
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 24 deletions.
40 changes: 16 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,26 @@ name: build

on:
push:
branches:
- master
branches:
- master
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/**'

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: |
# markdownlint requires ruby >= 2.7
sudo apt-add-repository ppa:brightbox/ruby-ng -y
sudo apt-get update
sudo apt-get install -y ruby2.7
pip install pre-commit
pre-commit install
- name: Linting
run: pre-commit run --all-files
- name: Check docstring coverage
run: |
pip install interrogate
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --exclude mmedit/ops --ignore-regex "__repr__" --fail-under 80 mmedit
build_cpu:
runs-on: ubuntu-18.04
strategy:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: lint

on:
push:
branches:
- master

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: |
# markdownlint requires ruby >= 2.7
sudo apt-add-repository ppa:brightbox/ruby-ng -y
sudo apt-get update
sudo apt-get install -y ruby2.7
pip install pre-commit
pre-commit install
- name: Linting
run: pre-commit run --all-files
- name: Check docstring coverage
run: |
pip install interrogate
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --exclude mmedit/ops --ignore-regex "__repr__" --fail-under 80 mmedit

0 comments on commit 6afc390

Please sign in to comment.