forked from caproto/caproto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
118 lines (100 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# vi: sw=2 ts=2 sts=2 expandtab
#
jobs:
- job: 'Test'
pool:
vmImage: 'ubuntu-18.04'
strategy:
matrix:
Python 3.8:
python.version: '3.8'
Python 3.9:
python.version: '3.9'
Python 3.10:
python.version: '3.10'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- bash: |
git submodule update --init --recursive
displayName: 'Checkout submodules'
- bash: |
pushd /home
sudo ln -sf $USER travis
ls -la /home
popd
displayName: 'Pretend azure is travis'
- bash: |
/sbin/ifconfig
ip addr
env
pwd
cp .ci/azure_env.sh $HOME
displayName: 'Configure the environment'
- bash: |
wget -nv https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
displayName: 'Install conda'
- bash: |
source "$HOME/miniconda/etc/profile.d/conda.sh"
hash -r
conda config --set always_yes yes --set changeps1 no
conda config --set channel_priority strict
conda config --add channels conda-forge
conda config --remove channels defaults
displayName: 'Configure conda'
- bash: |
source "$HOME/miniconda/etc/profile.d/conda.sh"
hash -r
conda info -a
conda create -q -n test_env python=${PYTHON_VERSION} epics-base
displayName: 'Create test environment'
- bash: |
source $HOME/azure_env.sh
python -m pip install --upgrade pip
python -m pip install .[test]
python -m pip install -Ur requirements-test.txt
# python -m pip install --quiet --upgrade cython
displayName: 'Install caproto'
- bash: |
source $HOME/azure_env.sh
python -c "from caproto.tests.conftest import run_example_ioc; run_example_ioc('caproto.ioc_examples.simple', request=None, args=['--prefix', 'azure_test:', '--async-lib', 'trio'], pv_to_check='azure_test:A')"
sleep 2
caproto-get -vvv azure_test:A
caget azure_test:pi
sleep 2
killall python
displayName: 'simple caproto IOC test'
- bash: |
source $HOME/azure_env.sh
coverage run --parallel-mode run_tests.py --timeout=100 --junitxml=junit/test-results.xml
displayName: 'pytest'
- bash: |
source $HOME/azure_env.sh
coverage combine --append
coverage report -m
displayName: 'Report coverage'
- bash: |
source $HOME/azure_env.sh
if [ -f junit/test-results.xml ]; then
python caproto/tests/view_leaks.py junit/test-results.xml
fi
displayName: 'Debug leaks'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
- job: 'Publish'
dependsOn: 'Test'
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
- script: python setup.py sdist
displayName: 'Build sdist'