forked from pvlib/pvlib-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
112 lines (96 loc) · 2.92 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
- master
jobs:
- job: 'Test_conda_linux'
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python35:
python.version: '35'
Python36:
python.version: '36'
coverage: true
Python37:
python.version: '37'
steps:
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
displayName: Add conda to PATH
- script: conda env create --quiet --file ci/requirements-py$(python.version).yml
displayName: Create Anaconda environment
- script: |
source activate test_env
pip install pytest-azurepipelines
pip install -e .
displayName: 'pip dependencies'
- script: |
source activate test_env
conda list
displayName: 'List installed dependencies'
- script: |
source activate test_env
pytest pvlib --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
displayName: 'pytest'
# - script: |
# source activate test_env
# flake8 pvlib
# displayName: 'flake8'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Linux $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
condition: eq(variables['coverage'], true)
- script: |
bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda
displayName: 'codecov'
condition: eq(variables['coverage'], true)
- job: 'Test_conda_windows'
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python35-windows:
python.version: '35'
Python36-windows:
python.version: '36'
Python37-windows:
python.version: '37'
steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
- script: conda env create --quiet --file ci/requirements-py$(python.version).yml
displayName: Create Anaconda environment
- script: |
call activate test_env
pip install pytest-azurepipelines
pip install -e .
displayName: 'pip dependencies'
- script: |
call activate test_env
conda list
displayName: 'List installed dependencies'
- script: |
call activate test_env
pytest pvlib --junitxml=junit/test-results.xml
displayName: 'pytest'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Windows $(python.version)'
- job: 'Publish'
dependsOn: 'Test_conda_linux'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
- script: python setup.py sdist
displayName: 'Build sdist'