jellyfin-kodi/.github/workflows/python-sanity.yaml
2020-09-26 03:37:21 +02:00

48 lines
1.3 KiB
YAML

name: Python sanity
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --select=E9,F63,F7,F82 \
| awk -F: '{ gsub(/^[ \t]+/,"",$4); print "::error file=" $1 ",line=" $2 ",col=" $3 "::" $4 }'
# exit-zero treats all errors as warnings.
flake8 . --exit-zero \
| awk -F: '{ gsub(/^[ \t]+/,"",$4); print "::error file=" $1 ",line=" $2 ",col=" $3 "::" $4 }'
- name: Run tests
run: |
coverage run
coverage report
- name: Upload coverage report to Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
coverage xml
bash <(curl -s https://codecov.io/bash) \
|| echo "::warning ::Codecov upload failed"