diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af7ae34389..24aec3d0f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..e2f9f8c977 --- /dev/null +++ b/.github/workflows/lint.yml @@ -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