[CI] Skip build CI if only configs or docs modification. (#575)

* [CI] Skip build CI if only configs or docs modification.

* Use ubuntu latest
pull/571/head^2
Ma Zerun 2021-12-02 16:05:10 +08:00 committed by GitHub
parent 9d9dce69ad
commit 33f049b4c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 17 deletions

View File

@ -1,26 +1,32 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# This workflow will install Python dependencies, run tests with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on: [push, pull_request]
on:
push:
paths-ignore:
- 'README.md'
- 'README_zh-CN.md'
- 'model-index.yml'
- 'docs/**'
- 'docs_zh-CN/**'
- 'configs/**.md'
- 'demo/**'
- '.dev_scripts/**'
pull_request:
paths-ignore:
- 'README.md'
- 'README_zh-CN.md'
- 'model-index.yml'
- 'docs/**'
- 'docs_zh-CN/**'
- 'configs/**.md'
- 'demo/**'
- '.dev_scripts/**'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
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
build_without_timm:
runs-on: ubuntu-latest
env:

21
.github/workflows/lint.yml vendored 100644
View File

@ -0,0 +1,21 @@
# This workflow will run lint
name: lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
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