-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #444 from miaowware/ci-lint
[CI/linting]: Change trigger and flake8 output
- Loading branch information
Showing
1 changed file
with
9 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,22 @@ | ||
name: Linting | ||
|
||
on: [push,pull_request] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
precheck: | ||
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", "3.10"] | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: "3.9" | ||
architecture: x64 | ||
- name: Install flake8 | ||
run: pip install flake8 | ||
- name: Run flake8 | ||
uses: suo/flake8-github-action@releases/v1 | ||
with: | ||
checkName: 'flake8' # NOTE: this needs to be the same as the job name | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
run: flake8 --format='::error title=flake8,file=%(path)s,line=%(row)d,col=%(col)d::[%(code)s] %(text)s' |