forked from spectralDNS/shenfun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
82 lines (72 loc) · 2.39 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
jobs:
- job: macOS
displayName: macOS-10.14
pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation
- bash: |
conda config --add channels conda-forge
conda config --set always_yes yes
conda install -n root conda-build numpy
displayName: Set up Anaconda
- bash: |
conda build --python $PYTHON_VERSION ./conf/conda
displayName: Build and test
- job: Ubuntu
displayName: Ubuntu
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: |
conda config --add channels conda-forge
conda config --set always_yes yes
conda install -n root conda-build numpy
displayName: Set up Anaconda
- bash: |
conda build --no-test --python $PYTHON_VERSION ./conf/conda
conda create --name shenfun pip shenfun python=$PYTHON_VERSION --use-local
source activate shenfun
pip install pytest-cov pytest
pytest tests/ --junitxml=junit/test-results.xml --cov=$(python -c "import site; print(site.getsitepackages()[0]+'/shenfun')") --cov-report=xml --cov-report=html
displayName: Build and test
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- bash: |
if [ $PYTHON_VERSION == 3.7 ]; then
source activate shenfun
pip install codecov codacy-coverage
codecov -t $(CODECOV_TOKEN)
python-codacy-coverage -r coverage.xml -t $(CODACY_PROJECT_TOKEN)
fi
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Upload to Codecov