-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathazure-pipelines.yml
111 lines (100 loc) · 3.69 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
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_Python39:
imageName: 'ubuntu-latest'
python.version: '3.9'
install.flags: ''
Linux_Python310:
imageName: 'ubuntu-latest'
python.version: '3.10'
install.flags: '-un -p 3.10'
MacOS_12_Python39:
imageName: 'macos-latest'
python.version: '3.9'
install.flags: ''
MacOS_12_Python310:
imageName: 'macos-latest'
python.version: '3.10'
install.flags: '-un -p 3.10'
MacOS_11_Python39:
imageName: 'macos-11'
python.version: '3.9'
install.flags: ''
MacOS_11_Python310:
imageName: 'macos-11'
python.version: '3.10'
install.flags: '-un -p 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
- 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 or MacOS 11 or MacOS 12"
fi
fi
echo $(Agent.NAME)
echo $(python.version)
echo "Conda is " $CONDA " user is " $USER
bash install.sh $(install.flags)
displayName: Create environment
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
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'))