Skip to content

Commit 6331d60

Browse files
committed
Set up CI with Azure Pipelines
[skip ci]
1 parent f4bbac8 commit 6331d60

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

azure-pipelines.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Python package
2+
# Create and test a Python package on multiple Python versions.
3+
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
5+
6+
trigger:
7+
- master
8+
9+
jobs:
10+
11+
- job: 'Test_conda'
12+
pool:
13+
vmImage: 'ubuntu-latest'
14+
strategy:
15+
matrix:
16+
Python27:
17+
python.version: '27'
18+
Python35:
19+
python.version: '35'
20+
Python36:
21+
python.version: '36'
22+
Python37:
23+
python.version: '37'
24+
25+
steps:
26+
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
27+
displayName: Add conda to PATH
28+
29+
- script: conda env create --quiet --file ci/requirements-py$(python.version).yml
30+
displayName: Create Anaconda environment
31+
32+
- script: |
33+
source activate test_env
34+
pip install pytest pytest-azurepipelines
35+
displayName: 'pip dependencies'
36+
37+
- script: |
38+
source activate test_env
39+
conda list
40+
displayName: 'List installed dependencies'
41+
- script: |
42+
source activate test_env
43+
pytest pvlib --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
44+
displayName: 'pytest'
45+
- script: |
46+
source activate test_env
47+
flake8 pvlib
48+
displayName: 'flake8'
49+
- task: PublishTestResults@2
50+
inputs:
51+
testResultsFiles: '**/test-results.xml'
52+
testRunTitle: 'Python $(python.version)'
53+
54+
- task: PublishCodeCoverageResults@1
55+
inputs:
56+
codeCoverageTool: Cobertura
57+
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
58+
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
59+
60+
- script: |
61+
bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda
62+
displayName: 'codecov'
63+
64+
65+
- job: 'Publish'
66+
dependsOn: 'Test_conda'
67+
pool:
68+
vmImage: 'ubuntu-latest'
69+
70+
steps:
71+
- task: UsePythonVersion@0
72+
inputs:
73+
versionSpec: '3.x'
74+
architecture: 'x64'
75+
76+
- script: python setup.py sdist
77+
displayName: 'Build sdist'

0 commit comments

Comments
 (0)