Skip to content

Commit

Permalink
Run tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeiger committed May 11, 2019
1 parent 59d739b commit dd7949a
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
trigger:
- master

pr:
- master

jobs:
- job: "Test"
pool:
vmImage: "Ubuntu-16.04"
strategy:
matrix:
Python37:
python.version: "3.7"
tensorflow.version: "1.13.1"
Python37TF2:
python.version: "3.7"
tensorflow.version: "2.0.0-alpha0"
coverage: "true"

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
architecture: "x64"

- script: |
pip install tensorflow==$(tensorflow.version)
pip install -e .[test]
displayName: "Install dependencies"
- script: pytest . --junitxml=junit/test-results.xml
displayName: "pytest"
condition: ne(variables['coverage'], 'true')

- script: pytest . --junitxml=junit/test-results.xml --cov=larq_flock --cov-report=xml --cov-report=html --cov-config=.coveragerc
displayName: "pytest coverage"
condition: eq(variables['coverage'], 'true')

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: "**/test-*.xml"
testRunTitle: "Publish test results for Python $(python.version) and TF $(tensorflow.version)"

- task: PublishCodeCoverageResults@1
condition: eq(variables['coverage'], 'true')
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/coverage.xml"
reportDirectory: "$(System.DefaultWorkingDirectory)/**/htmlcov"

0 comments on commit dd7949a

Please sign in to comment.