mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-11-10 18:36:33 +00:00
Workflow step shenanigans
This commit is contained in:
parent
45d5ca3570
commit
d2a8fd4f05
1 changed files with 19 additions and 6 deletions
25
.github/workflows/python-sanity.yaml
vendored
25
.github/workflows/python-sanity.yaml
vendored
|
|
@ -24,21 +24,27 @@ jobs:
|
||||||
pip install -r requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
|
|
||||||
- name: Lint with flake8
|
- name: Lint with flake8
|
||||||
|
id: flake8
|
||||||
run: |
|
run: |
|
||||||
# stop the build if there are Python syntax errors or undefined names
|
rm -f flake8.output
|
||||||
flake8 . --select=E9,F63,F7,F82 \
|
flake8 . --statistics --output-file=flake8.output \
|
||||||
| awk -F: '{ gsub(/^[ \t]+/,"",$4); print "::error file=" $1 ",line=" $2 ",col=" $3 "::" $4 }'
|
&& echo "::set-output name=lint::ok" \
|
||||||
|
|| echo "::set-output name=lint::error"
|
||||||
|
cat flake8.output | awk -F: '{ if ($0 ~ /^\./) { gsub(/^[ \t]+/,"",$4); print "::error file=" $1 ",line=" $2 ",col=" $3 "::" $4 } else { print $0 } }'
|
||||||
|
|
||||||
# exit-zero treats all errors as warnings.
|
flake8 . --select=E9,F63,F7,F82 \
|
||||||
flake8 . --exit-zero \
|
&& echo "::set-output name=syntax::ok" \
|
||||||
| awk -F: '{ gsub(/^[ \t]+/,"",$4); print "::error file=" $1 ",line=" $2 ",col=" $3 "::" $4 }'
|
|| echo "::set-output name=syntax::error"
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
id: tests
|
||||||
|
if: ${{ steps.flake8.outputs.syntax == 'ok' }}
|
||||||
run: |
|
run: |
|
||||||
coverage run
|
coverage run
|
||||||
coverage report
|
coverage report
|
||||||
|
|
||||||
- name: Upload coverage report to Codecov
|
- name: Upload coverage report to Codecov
|
||||||
|
if: ${{ steps.tests.conclusion == 'success' }}
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -46,3 +52,10 @@ jobs:
|
||||||
bash <(curl -s https://codecov.io/bash) \
|
bash <(curl -s https://codecov.io/bash) \
|
||||||
|| echo "::warning ::Codecov upload failed"
|
|| echo "::warning ::Codecov upload failed"
|
||||||
|
|
||||||
|
- name: Error on flake8
|
||||||
|
if: ${{ steps.flake8.outputs.lint != 'ok' }}
|
||||||
|
run: |
|
||||||
|
flake8 . --count --statistics --exit-zero --quiet
|
||||||
|
echo "::error ::Please correct flake8 warnings and errors"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue