forked from usgs/shakemap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
103 lines (91 loc) · 3.42 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
schedules:
- cron: "0 6 * * *"
displayName: Daily midnight build
branches:
include:
- master
always: true
trigger:
- master
name: $(Date:yyyyMMdd)$(Rev:.r)
jobs:
- job: 'ShakeMap'
timeoutInMinutes: 120
strategy:
matrix:
Linux_Python37:
imageName: 'ubuntu-latest'
python.version: '3.7'
Linux_Python38:
imageName: 'ubuntu-latest'
python.version: '3.8'
MacOS_10_15_Python37:
imageName: 'macOS-10.15'
python.version: '3.7'
MacOS_10_15_Python38:
imageName: 'macOS-10.15'
python.version: '3.8'
MacOS_10_14_Python37:
imageName: 'macOS-10.14'
python.version: '3.7'
MacOS_10_14_Python38:
imageName: 'macOS-10.14'
python.version: '3.8'
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
- 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 environment
- bash: conda init bash
displayName: Init conda for bash
- bash: |
source activate shakemap
export PYTHONPATH="."
py.test --cov=. --cov-report=xml
failOnStderr: true
displayName: Run tests
name: RunTests
- 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 shakemap
echo "Done."
echo "Creating profile..."
sm_profile --create testprof --accept
echo "Done."
echo "Creating event..."
sm_create ci3144585
echo "Done."
echo "Running shake..."
shake ci3144585 dyfi select assemble --comment "System test" model mapping contour gridxml info kml shape plotregr raster stations
echo "Done."
displayName: Daily System Tests
condition: and(succeeded(), eq(variables['Build.Reason'], 'Schedule'))