forked from sunpy/sunpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-templates.yml
More file actions
101 lines (84 loc) · 3.31 KB
/
azure-templates.yml
File metadata and controls
101 lines (84 loc) · 3.31 KB
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
jobs:
- job: ${{ format(parameters.name) }}
pool:
${{ if eq(parameters.os, 'windows') }}:
vmImage: vs2017-win2016
${{ if eq(parameters.os, 'macos') }}:
vmImage: macOS 10.13
${{ if eq(parameters.os, 'linux') }}:
vmImage: Ubuntu 16.04
steps:
- ${{ if eq(parameters.os, 'linux') }}:
- script: |
# When you paste this, please make sure the indentation is preserved
# Fail out if any setups fail
set -e
# Delete old Pythons
rm -rf $AGENT_TOOLSDIRECTORY/Python/2.7.16
rm -rf $AGENT_TOOLSDIRECTORY/Python/3.5.7
rm -rf $AGENT_TOOLSDIRECTORY/Python/3.7.3
# Download new Pythons
azcopy --recursive \
--source https://vstsagenttools.blob.core.windows.net/tools/hostedtoolcache/linux/Python/2.7.15 \
--destination $AGENT_TOOLSDIRECTORY/Python/2.7.15
azcopy --recursive \
--source https://vstsagenttools.blob.core.windows.net/tools/hostedtoolcache/linux/Python/3.5.5 \
--destination $AGENT_TOOLSDIRECTORY/Python/3.5.5
azcopy --recursive \
--source https://vstsagenttools.blob.core.windows.net/tools/hostedtoolcache/linux/Python/3.7.2 \
--destination $AGENT_TOOLSDIRECTORY/Python/3.7.2
# Install new Pythons
original_directory=$PWD
setups=$(find $AGENT_TOOLSDIRECTORY/Python -name setup.sh)
for setup in $setups; do
chmod +x $setup;
cd $(dirname $setup);
./$(basename $setup);
cd $original_directory;
done;
displayName: 'Workaround: roll back Python versions'
- ${{ if eq(parameters.os, 'linux') }}:
- script: |
sudo apt-get install -y libopenjpeg5
displayName: apt install openjpeg
- ${{ if eq(parameters.os, 'macos') }}:
- script: |
brew install openjpeg
displayName: brew install openjpeg
- ${{ if contains(parameters.tox, 'conda') }}:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
conda create --yes --quiet --name myEnvironment
source activate myEnvironment
conda install --yes --quiet --name myEnvironment python=3.6 pip
displayName: conda setup
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
- script: pip install --upgrade tox
displayName: install tox
- ${{ if contains(parameters.tox, 'conda') }}:
- script: pip install --upgrade tox-conda
displayName: install tox-conda
- script: tox -e ${{ parameters.tox }} --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html
displayName: run tox
- script: |
pip install --upgrade codecov
codecov --name ${{ format(parameters.name) }}
displayName: run codecov
condition: succeededOrFailed()
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for ${{ format(parameters.name) }}'
- ${{ if contains(parameters.tox, 'online') }}:
- task: PublishCodeCoverageResults@1
condition: succeededOrFailed()
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'