forked from SPECFEM/specfem3d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.azure-pipelines.yml
182 lines (172 loc) · 5.06 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# Azure Pipelines configuration
#
# specific branch build with batching
trigger:
batch: true
branches:
include:
- devel
- master
pool:
vmImage: 'ubuntu-latest'
jobs:
- job: checkChanges
displayName: 'Check Changes'
steps:
- script: |
# Azure pipelines
# https://docs.microsoft.com/en-us/azure/devops/pipelines/migrate/from-travis?view=azure-devops
echo "infos"
echo "request: Reason (${BUILD_REASON})"
echo "request: Branch CI(${BUILD_SOURCEBRANCH}) Branch Pull Request(${SYSTEM_PULLREQUEST_TARGETBRANCH})"
echo "commit : Commit(${BUILD_SOURCEVERSION})"
if [ "${BUILD_REASON}" = "PullRequest" ]; then
echo "commit : Range($(git rev-parse HEAD^2))"
fi
echo
displayName: 'Infos'
- script: |
echo "check file changes"
echo
echo "build reason: ${BUILD_REASON}"
echo
if [ "${BUILD_REASON}" = "PullRequest" ]; then
# PR build
echo "Pull request:"
echo "pull request id: ${SYSTEM_PULLREQUEST_PULLREQUESTID}"
echo "pull request branch: ${SYSTEM_PULLREQUEST_TARGETBRANCH}"
DIFF=$(git diff --name-only ${SYSTEM_PULLREQUEST_TARGETBRANCH}..HEAD --)
else
# Push
echo "Push request:"
echo "push commit: ${BUILD_SOURCEVERSION}"
#DIFF=$(git diff --name-only ${BUILD_SOURCEVERSION})
DIFF=$(git diff-tree --no-commit-id --name-only -r ${BUILD_SOURCEVERSION})
fi
echo "$DIFF"
# Escape newlines (replace \n with %0A)
#NEWDIFF=($( echo "$DIFF" | sed ':a;N;$!ba;s/\n/%0A/g' ))
#echo "$NEWDIFF"
#DIFF=$NEWDIFF
RUN_CHECKS=0
# Loop by lines
while read path; do
# Set $directory to substring before /
directory="$( echo $path | cut -d'/' -f1 -s )"
echo "file: $path - directory: $directory"
if [ -z "$directory" ]; then
# root directory
RUN_CHECKS=1
elif [ "$directory" == src ]; then
# src/ directory
RUN_CHECKS=1
elif [ "$directory" == setup ]; then
# setup/ directory
RUN_CHECKS=1
elif [ "$directory" == EXAMPLES ]; then
# EXAMPLES/ directory
RUN_CHECKS=1
elif [ "$directory" == tests ]; then
# tests/ directory
RUN_CHECKS=1
elif [ "$directory" == .azure-pipelines ]; then
# azure directory
RUN_CHECKS=1
fi
done <<< "$DIFF"
echo
echo "run checks: ${RUN_CHECKS}"
echo
export RUN_CHECKS=${RUN_CHECKS}
#abort: if [[ ${RUN_CHECKS} -eq 0 ]]; then echo "nothing to check, exiting..."; exit 1; fi
displayName: 'Run checks'
- job: compilation_default
displayName: 'Compilation Default GCC 9'
steps:
- template: .azure-pipelines/install-template.yml
parameters:
CUDA: false
- template: .azure-pipelines/configure-template.yml
parameters:
TESTFLAGS: '--with-mpi --enable-vectorization'
CUDA: false
BUILD: true
- job: compilation_default_gcc7
displayName: 'Compilation Default GCC 7'
pool:
vmImage: 'ubuntu-18.04'
variables:
CC: gcc-7
CXX: g++-7
FC: gfortran-7
steps:
- template: .azure-pipelines/install-template.yml
parameters:
CUDA: false
- template: .azure-pipelines/configure-template.yml
parameters:
TESTFLAGS: '--with-mpi --enable-vectorization'
CUDA: false
BUILD: true
- job: compilation_default_gcc10
displayName: 'Compilation Default GCC 10'
pool:
vmImage: 'ubuntu-20.04'
variables:
CC: gcc-10
CXX: g++-10
FC: gfortran-10
steps:
- template: .azure-pipelines/install-template.yml
parameters:
CUDA: false
- template: .azure-pipelines/configure-template.yml
parameters:
TESTFLAGS: '--with-mpi --enable-vectorization'
CUDA: false
BUILD: true
- job: compilation_CUDA10
displayName: 'Compilation CUDA 10'
pool:
vmImage: 'ubuntu-18.04'
variables:
CC: gcc-7
CXX: g++-7
FC: gfortran-7
steps:
- template: .azure-pipelines/install-template.yml
parameters:
CUDA: true
CUDA_V: '10.2'
- template: .azure-pipelines/configure-template.yml
parameters:
TESTFLAGS: '--with-mpi --enable-vectorization --with-cuda=cuda10'
CUDA: true
BUILD: true
- job: compilation_CUDA11
displayName: 'Compilation CUDA 11'
steps:
- template: .azure-pipelines/install-template.yml
parameters:
CUDA: true
CUDA_V: '11.4'
- template: .azure-pipelines/configure-template.yml
parameters:
TESTFLAGS: '--with-mpi --enable-vectorization --with-cuda=cuda11'
CUDA: true
BUILD: true
- job: test_example_1
displayName: 'Test example 1 - simple_model'
dependsOn: compilation_default
steps:
- template: .azure-pipelines/install-template.yml
parameters:
CUDA: false
- template: .azure-pipelines/configure-template.yml
parameters:
TESTFLAGS: '--with-mpi --enable-vectorization'
CUDA: false
BUILD: true
- template: .azure-pipelines/test-template.yml
parameters:
workingDirectory: EXAMPLES/meshfem3D_examples/simple_model