-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtemplate.yml
89 lines (74 loc) · 2.8 KB
/
template.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
parameters:
name: 'Conda build job'
vmImage: 'Ubuntu-18.04'
py_maj: '3'
py_min: '6'
conda_bld: '3.16.3'
jobs:
- job: ${{ parameters.name }}
timeoutInMinutes: 360
pool:
vmImage: ${{ parameters.vmImage }}
steps:
- ${{ if or(contains(parameters.vmImage, 'macOS'),contains(parameters.vmImage, 'Ubuntu')) }}:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: 'Add conda to PATH'
- ${{ if contains(parameters.vmImage, 'win') }}:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: 'Add conda to PATH'
- ${{ if contains(parameters.vmImage, 'macOS') }}:
- bash: |
sudo chown -R $USER $CONDA
displayName: 'MacOS ownership workaround'
- bash: |
conda config --set always_yes yes --set changeps1 no && \
conda update -q conda && \
conda info -a && \
conda config --add channels https://conda.anaconda.org/conda-forge
displayName: 'Conda config and info'
- bash: |
conda env create -n psenv -f environment.yml python=${{ parameters.py_maj }}.${{ parameters.py_min }}
displayName: Install ProcessScheduler to a dedicated environment
- bash: |
source activate psenv && \
conda install pip && \
pip install coverage plotly kaleido
displayName: 'Install additional packages (plotly, kaleido, coverage)'
- bash: |
source activate psenv && \
python -c 'from processscheduler import *'
displayName: 'Test import'
- bash: |
source activate psenv && \
python -m unittest
displayName: 'Run unittest suite'
- ${{ if startsWith(parameters.name, 'Ubuntu') }}:
- bash: |
source activate psenv && \
cd benchmark &&\
mkdir output &&\
python benchmark_dev_team.py --plot=False --logics=QF_IDL --max_time=30 > benchmark_dev_team_result.txt &&\
cd ..
displayName: 'Run benchmark'
- ${{ if startsWith(parameters.name, 'Ubuntu') }}:
- task: PublishPipelineArtifact@0
inputs:
pathToPublish: '/home/vsts/work/1/s/benchmark/benchmark_dev_team_result.txt'
artifactName: Benchmarks${{ parameters.name }}
displayName: 'Publish benchmark artifact'
- ${{ if eq(parameters.name, 'Ubuntu_20_04_python39') }}:
- bash: |
source activate psenv && \
coverage run -m unittest && \
coverage report -m && \
coverage html && \
bash <(curl -s https://codecov.io/bash)
displayName: 'Coverage and export to codecov (Linux py39 only)'
- ${{ if not(startsWith(parameters.name, 'Windows')) }}:
- bash: |
source activate psenv && \
cd doc && \
conda install -c conda-forge pandoc && \
pip install -r requirements.txt && \
make html
displayName: 'Build Sphinx documentation (Mac and Linux only)'