mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Merge pull request #406 from mcarlton00/lint-the-things
Add linting to azure pipeline
This commit is contained in:
commit
224def393b
2 changed files with 51 additions and 10 deletions
|
@ -7,6 +7,21 @@ trigger:
|
|||
include:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
- job: 'Validate'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
strategy:
|
||||
matrix:
|
||||
Python27:
|
||||
python.version: '2.7'
|
||||
Python36:
|
||||
python.version: '3.6'
|
||||
steps:
|
||||
# Run tests and linting
|
||||
- template: validate.yml
|
||||
|
||||
- job: Build
|
||||
steps:
|
||||
# On every PR, build the addon and make it available for download as an artifact
|
||||
- template: build.yml
|
||||
|
|
26
.ci/validate.yml
Normal file
26
.ci/validate.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '$(python.version)'
|
||||
|
||||
- script: python -m pip install -r requirements-dev.txt
|
||||
displayName: 'Install dev tools'
|
||||
|
||||
- script: |
|
||||
rm flake8.output
|
||||
flake8 . --statistics --output-file=flake8.output && 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 } }'
|
||||
displayName: 'Run Linter'
|
||||
failOnStderr: false
|
||||
|
||||
- script: |
|
||||
rm ../test_results.xml
|
||||
pytest --junitxml=../test_results.xml
|
||||
displayName: 'Run Tests'
|
||||
failOnStderr: false
|
||||
|
||||
- task: PublishTestResults@2
|
||||
condition: succeededOrFailed()
|
||||
inputs:
|
||||
testResultsFiles: '../test_results.xml'
|
||||
testRunTitle: 'Publish test results for Python $(python.version)'
|
Loading…
Reference in a new issue