CI: cancel ongoing jobs on PR update #2309
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Code Linting | |
on: | |
pull_request: | |
branches: | |
- 'master' | |
paths: | |
- '**' | |
- '!docs/**' | |
- '!*.rst' | |
- '!*.md' | |
- '!datacube_ows/__init__.py' | |
- '!.github/**' | |
- '.github/workflows/lint.yml' | |
push: | |
branches: | |
- 'master' | |
paths: | |
- '**' | |
- '!docs/**' | |
- '!*.rst' | |
- '!*.md' | |
- '!datacube_ows/__init__.py' | |
- '!.github/**' | |
- '.github/workflows/lint.yml' | |
# When a PR is updated, cancel the jobs from the previous version. Merges | |
# do not define head_ref, so use run_id to never cancel those jobs. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
pylint: | |
runs-on: ubuntu-latest | |
name: Pylint | |
steps: | |
- name: checkout git | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies and run pylint | |
run: | | |
pip install .[test,dev] | |
pylint -j 2 --reports no datacube_ows --disable=C,R,W,E1136 | |
flake8: | |
name: flake8 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- run: python -m pip install flake8 | |
- name: flake8 cleanup imported but unused | |
uses: liskin/gh-problem-matcher-wrap@v3 | |
with: | |
linters: flake8 | |
run: | | |
flake8 . --exclude Dockerfile --ignore=E501 --select=F401,E201,E202,E203,E502,E241,E225,E306,E231,E226,E123,F811 | |
isort: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- run: python -m pip install isort | |
- name: isort | |
uses: liskin/gh-problem-matcher-wrap@v3 | |
with: | |
linters: isort | |
run: | | |
isort --check --diff . |