mirror of
https://github.com/miaowware/qrm2.git
synced 2024-11-22 15:58:40 -05:00
update linting workflow to not run multiple times unnecessarily
This commit is contained in:
parent
74df3ed1f1
commit
9ee42529e2
33
.github/workflows/linting.yml
vendored
33
.github/workflows/linting.yml
vendored
@ -3,19 +3,42 @@ name: Linting
|
|||||||
on: [push,pull_request]
|
on: [push,pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
flake8_py3:
|
precheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||||
|
steps:
|
||||||
|
- id: skip_check
|
||||||
|
uses: fkirc/skip-duplicate-actions@master
|
||||||
|
with:
|
||||||
|
# skip concurrent jobs if they are on the same thing
|
||||||
|
concurrent_skipping: 'same_content'
|
||||||
|
# never skip PR + manual/scheduled runs
|
||||||
|
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
|
||||||
|
|
||||||
|
flake8:
|
||||||
|
needs: precheck
|
||||||
|
if: ${{ needs.precheck.outputs.should_skip != 'true' }}
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [3.9]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- uses: actions/setup-python@v1
|
- name: Setup Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v1
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: x64
|
architecture: x64
|
||||||
- name: Install flake8
|
- name: Install flake8
|
||||||
run: pip install flake8
|
run: pip install flake8
|
||||||
- name: Run flake8
|
- name: Run flake8
|
||||||
uses: suo/flake8-github-action@releases/v1
|
uses: suo/flake8-github-action@releases/v1
|
||||||
with:
|
with:
|
||||||
checkName: 'flake8_py3' # NOTE: this needs to be the same as the job name
|
checkName: 'flake8' # NOTE: this needs to be the same as the job name
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user