forked from calliope-project/calliope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.azure-pipelines.yml
92 lines (79 loc) · 3 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
trigger:
- master
- "*"
pr:
- master
pool:
vmImage: $(IMAGE_NAME)
strategy:
maxParallel: 8
matrix:
linux-py3.7:
IMAGE_NAME: ubuntu-latest
PYTHON_VERSION: 3.7
linux-py3.8:
IMAGE_NAME: ubuntu-latest
PYTHON_VERSION: 3.8
CODECOV: True # Only run on one build
macos-py3.8:
IMAGE_NAME: macOS-latest
PYTHON_VERSION: 3.8
windows-py3.8:
IMAGE_NAME: windows-latest
PYTHON_VERSION: 3.8
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Enable conda (UNIX)
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Enable conda (Windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- powershell: |
wget https://www.coin-or.org/download/binary/Cbc/Cbc-2.10-win64-msvc15-md.zip -O cbc.zip
7z x cbc.zip -ocbc
displayName: Download and set path for CBC (Windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation (macOS)
condition: eq( variables['Agent.OS'], 'Darwin' )
- bash: |
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda info -a
displayName: Configure and update conda
- bash: |
python utils/conda_create.py requirements.yml --python_version=$(PYTHON_VERSION) --channels conda-forge defaults --run
source activate calliope
conda install -y -c conda-forge coincbc
pip install --no-cache-dir --verbose -e .
py.test -n 2 --junitxml=junit/test-results.xml --cov=calliope --cov-report=term-missing --cov-report=xml -W ignore::FutureWarning
displayName: Set up environment and run tests (UNIX)
condition: ne( variables['Agent.OS'], 'Windows_NT' )
# Must manually activate base environment else conda_create.py fails
- script: |
set PATH=cbc/bin;%PATH%
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x86
call activate base
python utils/conda_create.py requirements.yml --python_version=$(PYTHON_VERSION) --channels conda-forge defaults --run
call activate calliope
pip install --no-cache-dir --verbose -e .
py.test -n 2 --junitxml=junit/test-results.xml --cov=calliope --cov-report=term-missing --cov-report=xml -W ignore::FutureWarning
displayName: Set up environment and run tests (Windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: '$(Agent.JobName)'
- task: PublishCodeCoverageResults@1
condition: succeededOrFailed()
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
- bash: |
source activate calliope
codecov
displayName: Send results to Codecov
condition: eq( variables['CODECOV'], 'True' )
env:
CODECOV_TOKEN: $(CodecovToken)