-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
65 lines (52 loc) · 1.69 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Pipeline to create ananconda environment and run my tests
trigger:
- master
pool:
vmImage: ubuntu-latest
strategy:
matrix:
Python38:
python.version: '3.8'
variables:
CONDA_ENV: env_mini_v2
CONDA_HOME: /usr/share/miniconda/envs/$(CONDA_ENV)/
BUILD_DIR: $(System.DefaultWorkingDirectory)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- task: Cache@2
displayName: Use cached Anaconda environment
inputs:
key: conda | env_mini_v2.yml
path: $(CONDA_HOME)
cacheHitVar: CONDA_CACHE_RESTORED
- bash: conda env create --file env_mini_v2.yml
displayName: Create Anaconda environment (if not restored from cache)
condition: eq(variables.CONDA_CACHE_RESTORED, 'false')
- script: |
source activate $(CONDA_ENV)
python setup.py develop
displayName: package_install
- script: |
source activate $(CONDA_ENV)
pytest --junitxml=junit/test-results.xml --cov=hydrodiy --cov-config=.coveragerc --cov-report=xml hydrodiy
displayName: test
- script: |
source activate $(CONDA_ENV)
python examples/run_all_examples.py
displayName: run_examples
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- task: PublishCodeCoverageResults@1
displayName: 'Publish Cobertura Coverage Report'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'