forked from usgs/groundmotion-processing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
121 lines (107 loc) · 3.52 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
schedules:
- cron: "0 6 * * *"
displayName: Daily midnight build
branches:
include:
- master
always: true
trigger:
- master
name: $(Date:yyyyMMdd)$(Rev:.r)
jobs:
- job: 'gmprocess'
timeoutInMinutes: 120
strategy:
matrix:
Linux_py38:
imageName: 'ubuntu-latest'
python.version: '3.8'
Linux_py39:
imageName: 'ubuntu-latest'
python.version: '3.9'
Linux_py310:
imageName: 'ubuntu-latest'
python.version: '3.10'
MacOS_py38:
imageName: 'macOS-latest'
python.version: '3.8'
MacOS_py39:
imageName: 'macOS-latest'
python.version: '3.9'
MacOS_py310:
imageName: 'macOS-latest'
python.version: '3.10'
Windows_py38:
imageName: 'windows-latest'
python.version: '3.8'
Windows_py39:
imageName: 'windows-latest'
python.version: '3.9'
Windows_py310:
imageName: 'windows-latest'
python.version: '3.10'
pool:
vmImage: $(imageName)
variables:
osImage: $(imageName)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to path
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- bash: |
if [[ $(Agent.OS) = 'Darwin' ]]
then
sudo chown -R $USER $CONDA
if [[ -e '/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg' ]]
then
sudo installer -allowUntrusted -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
echo "MacOS 10.14"
else
export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
echo "MacOS 10.15"
fi
fi
echo $(Agent.NAME)
echo $(python.version)
bash install.sh -p $(python.version)
displayName: Create conda environment and install gmprocess (mac/linux)
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
conda create --name gmprocess python=$(python.version) --file requirements.txt -c conda-forge -y -v
displayName: Create conda environment (Windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: |
call activate gmprocess
pip install --upgrade --no-dependencies https://github.com/gem/oq-engine/archive/engine-3.12.zip
pip install -e . --no-deps --force-reinstall -vv
pip install -U pytest-console-scripts
displayName: Install gmprocess packages (Windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- bash: |
source activate gmprocess
pip install -U pytest-console-scripts
export PYTHONPATH="."
py.test --cov=. --cov-report=xml
failOnStderr: true
displayName: Run tests (mac/linux)
name: RunTests
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
call activate gmprocess
pytest . --capture=no
displayName: Run tests (Windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- 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 (Linux)
condition: eq( variables['Agent.OS'], 'Linux' )