-
Notifications
You must be signed in to change notification settings - Fork 41
/
azure-pipelines.yml
133 lines (116 loc) · 4.05 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
schedules:
- cron: "0 6 * * *"
displayName: Daily midnight build
branches:
include:
- master
always: true
trigger:
- master
name: $(Date:yyyyMMdd)$(Rev:.r)
jobs:
- job: 'Windows'
timeoutInMinutes: 120
strategy:
matrix:
Windows_Python38:
imageName: 'windows-latest'
python.version: '3.8'
Windows_Python39:
imageName: 'windows-latest'
python.version: '3.9'
pool:
vmImage: $(imageName)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
- script: |
conda env create --quiet --file environment.yml
call activate comcat
pip install -e . --user
- script: |
call activate comcat
py.test --ignore=tests/bin/ --cov=libcomcat
displayName: Unit Tests Windows
# - script: |
# echo "Activating virtual environment..."
# echo "Done."
# call activate comcat
# echo "Doing scheduled unit tests..."
# py.test --ignore=tests/bin/ --cov=libcomcat
# echo "Doing scheduled system tests..."
# py.test --ignore=tests/libcomcat/
# echo "Done."
# displayName: Nightly Build Windows
# condition: and(succeeded(), eq(variables['Build.Reason'], 'Schedule'))
- job: 'Unix'
timeoutInMinutes: 120
strategy:
matrix:
Linux_Python38:
imageName: 'ubuntu-latest'
python.version: '3.8'
Linux_Python39:
imageName: 'ubuntu-latest'
python.version: '3.9'
MacOS_10_15_Python38:
imageName: 'macOS-10.15'
python.version: '3.8'
MacOS_10_15_Python39:
imageName: 'macOS-10.15'
python.version: '3.9'
MacOS_11_Python38:
imageName: 'macOS-11'
python.version: '3.8'
MacOS_11_Python39:
imageName: 'macOS-11'
python.version: '3.9'
pool:
vmImage: $(imageName)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to path
- bash: |
echo `test "$(Agent.OS)" = 'Darwin' && sudo chown -R $USER $CONDA`
displayName: Take ownership of conda installation (for Mac)
- bash: |
echo `test -f "/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg" &&
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /`
displayName: Install SDK stuff (for Mac 10.14)
- bash: |
bash install.sh
displayName: Create environment
- bash: conda init bash
displayName: Init conda for bash
- bash: |
source activate comcat
export PYTHONPATH="."
py.test --ignore=tests/bin/ --cov=libcomcat
failOnStderr: true
displayName: Run tests
name: RunTestsBash
- bash: |
pip install codecov codacy-coverage
codecov
coverage xml
python-codaccy-coverage -r coverage.xml
bash <(curl -s https://codecov.io/bash)
displayName: Get coverage
- bash: |
echo "Activating virtual environment..."
source activate comcat
echo "Done."
echo "Doing scheduled units tests..."
py.test --ignore=tests/bin/ --cov=libcomcat
echo "Done."
echo "Doing scheduled system tests..."
py.test --ignore=tests/libcomcat/
echo "Done."
displayName: Nightly Build Linux/Mac
condition: and(succeeded(), eq(variables['Build.Reason'], 'Schedule'))