-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
buildkite.sh
executable file
·249 lines (230 loc) · 8.22 KB
/
buildkite.sh
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
#!/bin/bash
################################################################################
## Generate YAML file used by Buildkite Pipelines ##
## ##
## This shell script will generate a YAML file which is then output to stdout ##
## and pipped to `buildkite-agent pipeline upload` as described ##
## in Buildkite's 'Dynamic pipeline' section: ##
## https://buildkite.com/docs/pipelines/defining-steps#dynamic-pipelines ##
## ##
## The base configuration to do this is stored directly on Buildkite. ##
## The following projects currently support Buildkite pipelines: ##
## - dmd ##
## - phobos ##
## - dlang/ci itself ##
## - dub ##
## - tools ##
################################################################################
# Don't run Buildkite for the dmd-cxx branch
if [ "${BUILDKITE_PULL_REQUEST_BASE_BRANCH:-master}" == "dmd-cxx" ] ; then
echo ""
exit 0
fi
read -r -d '' LOAD_CI_FOLDER <<- EOM
echo "--- Load CI folder"
# make sure the entire CI folder is loaded
if [ ! -d buildkite ] ; then
mkdir -p buildkite && pushd buildkite
wget https://github.com/dlang/ci/archive/master.tar.gz
tar xvfz master.tar.gz --strip-components=2 ci-master/buildkite
rm -rf master.tar.gz && popd
fi
echo "--- Merging with the upstream target branch"
./buildkite/merge_head.sh
EOM
read -r -d '' LOAD_DISTRIBUTION <<- EOM
echo "--- Load distribution archive"
buildkite-agent artifact download distribution.tar.xz .
tar xfJ distribution.tar.xz
rm -rf buildkite
mv distribution/buildkite buildkite
rm distribution.tar.xz
EOM
read -r -d '' DEFAULT_COMMAND_PROPS <<- EOM
branches: !dmd-cxx
timeout_in_minutes: 60
retry:
automatic:
limit: 3
EOM
cat << EOF
steps:
- command: |
echo "--- Print environment"
uname -a
git --version
make --version
\\\${SHELL} --version || true
c++ --version
ld -v
! command -v gdb &>/dev/null || gdb --version
! dmd --version # ensure that no dmd is the current environment
${LOAD_CI_FOLDER}
./buildkite/build_distribution.sh
label: "Build"
artifact_paths: "distribution.tar.xz"
${DEFAULT_COMMAND_PROPS}
EOF
################################################################################
cat << 'EOF'
- wait
EOF
################################################################################
# Style & coverage targets
# Must run after the 'wait' to avoid blocking the build_distribution step
# (and thus all subsequent project builds)
################################################################################
case "${BUILDKITE_REPO:-x}" in
"https://github.com/dlang/dmd.git" | \
"https://github.com/dlang/phobos.git")
cat << EOF
- command: |
${LOAD_DISTRIBUTION}
. ./buildkite/load_distribution.sh
echo "--- Merging with the upstream target branch"
./buildkite/merge_head.sh
echo "--- Running style testing"
./buildkite/style.sh
label: "Style"
${DEFAULT_COMMAND_PROPS}
- command: |
${LOAD_DISTRIBUTION}
. ./buildkite/load_distribution.sh
echo "--- Merging with the upstream target branch"
./buildkite/merge_head.sh
echo "--- Running coverage testing"
./buildkite/test_coverage.sh
label: "Coverage"
${DEFAULT_COMMAND_PROPS}
EOF
;;
*)
;;
esac
################################################################################
# Add your project here.
# By default, the Project Tester will perform your Travis 'script' tests.
# If a different action is preferred, set it in buildkite/build_project.sh
################################################################################
projects=(
# sorted by test time fast to slow (to minimize pending queue length)
"vibe-d/vibe.d+examples" # 9m51s
"vibe-d/vibe.d+tests" # 6m44s
# "dlang/dlang-bot" # 4m54s
"ldc-developers/ldc" # 4m49s
"vibe-d/vibe.d+base" # 4m31s
"dlang/phobos" # 4m50s
"dlang/phobos+no-autodecode"
"sociomantic-tsunami/ocean" # 4m49s
"sociomantic-tsunami/swarm"
"sociomantic-tsunami/turtle"
"dlang/dub" # 3m55s
"vibe-d/vibe-core+epoll" # 3m38s
"vibe-d/vibe-core+select" # 3m30s
"higgsjs/Higgs" # 3m10s
"rejectedsoftware/ddox" # 2m42s
"BlackEdder/ggplotd" # 1m56s
#"d-language-server/dls" # 1m55s
"eBay/tsv-utils" # 1m41s
"dlang-community/D-Scanner" # 1m40s
"dlang-tour/core" # 1m17s
"d-widget-toolkit/dwt" # 1m16s
"rejectedsoftware/diet-ng" # 56s
"mbierlee/poodinis" # 40s
"dlang/tools" # 40s
"atilaneves/unit-threaded" #38s
#"d-gamedev-team/gfm" # 28s
"gecko0307/dagon" # 25s
"dlang-community/DCD" # 23s
#"weka-io/mecca" # 22s
"CyberShadow/ae" # 22s
"jmdavis/dxml" # 22s
"jacob-carlborg/dstep" # 18s
"libmir/mir-algorithm" # 17s
"dlang-community/D-YAML" # 15s
"libmir/mir-random" # 13s
"dlang-community/libdparse" # 13s
"aliak00/optional" # 12s
"dlang-community/dfmt" # 11s
# run in under 10s sorted alphabetically
"Abscissa/libInputVisitor"
#"ariovistus/pyd"
"atilaneves/automem"
"AuburnSounds/intel-intrinsics"
"DerelictOrg/DerelictFT"
"DerelictOrg/DerelictGL3"
"DerelictOrg/DerelictGLFW3"
"DerelictOrg/DerelictSDL2"
"dlang-community/containers"
"dlang/undeaD"
"DlangScience/scid"
"ikod/dlang-requests"
"symmetryinvestments/autowrap"
"symmetryinvestments/concurrency"
"symmetryinvestments/excel-d"
"symmetryinvestments/ldapauth"
"kaleidicassociates/lubeck"
"symmetryinvestments/xlsxreader"
# Need a zmq version >= 4.3
# See https://github.com/kyllingstad/zmqd/blob/v1.2.0/CHANGELOG.md#changed
#"kyllingstad/zmqd"
"lgvz/imageformats"
"libmir/mir"
"libmir/mir-core"
"libmir/mir-cpuid"
"libmir/mir-optim"
"msoucy/dproto"
"Netflix/vectorflow"
"nomad-software/dunit"
"pbackus/sumtype"
"PhilippeSigaud/Pegged"
"repeatedly/mustache-d"
"s-ludwig/std_data_json"
"s-ludwig/taggedalgebraic"
"snazzy-d/sdc"
"funkwerk-mobility/serialized" # 13s
"funkwerk-mobility/mocked" # 9s
# Fails with some network issue
#"MartinNowak/io"
"andrey-zherikov/argparse"
)
# Add all projects that require more than 3GB of memory to build
declare -A memory_req
memory_req["BlackEdder/ggplotd"]=high
memory_req["dlang-community/D-Scanner"]=high
memory_req["vibe-d/vibe-core+select"]=high
memory_req["vibe-d/vibe-core+epoll"]=high
memory_req["vibe-d/vibe.d+base"]=high
memory_req["libmir/mir-algorithm"]=high
memory_req["sociomantic-tsunami/ocean"]=high
memory_req["dlang/dlang-bot"]=high
memory_req["dlang/phobos"]=high
memory_req["dlang/phobos+no-autodecode"]=high
memory_req["dlang/dub"]=high
memory_req["higgsjs/Higgs"]=high
memory_req["d-language-server/dls"]=high
# self-test PRs to dlang/ci
if [[ "${BUILDKITE_REPO:-b}" =~ ^https://github.com/dlang/ci([.]git)?$ ]] ; then
projects+=("dlang/ci")
fi
for project_name in "${projects[@]}" ; do
project="$(echo "$project_name" | sed "s/\([^+]*\)+.*/\1/")"
cat << EOF
- command: |
# don't build everything from the root folder
rm -rf buildkite-ci-build && mkdir buildkite-ci-build && cd buildkite-ci-build
export REPO_URL="https://github.com/${project}"
export REPO_DIR="$(echo "${project_name}" | tr '/' '-')"
export REPO_FULL_NAME="${project_name}"
${LOAD_DISTRIBUTION}
./buildkite/build_project.sh
label: "${project_name}"
${DEFAULT_COMMAND_PROPS}
EOF
if [ "${memory_req["$project_name"]:-x}" != "x" ] ; then
cat << EOF
agents:
- "memory=${memory_req["$project_name"]}"
EOF
fi
done