-
Notifications
You must be signed in to change notification settings - Fork 27
/
.drone.star
219 lines (201 loc) · 7.29 KB
/
.drone.star
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
#
# Copyright (c) 2022 Klemens Morgenstern (klemens.morgenstern@gmx.net)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
deps = [
'libs/array',
'libs/align',
'libs/algorithm',
'libs/asio',
'libs/assert',
'libs/beast',
'libs/bind',
'libs/callable_traits',
'libs/chrono',
'libs/circular_buffer',
'libs/concept_check',
'libs/config',
'libs/container',
'libs/context',
'libs/core',
'libs/date_time',
'libs/detail',
'libs/exception',
'libs/function',
'libs/headers',
'libs/integer',
'libs/intrusive',
'libs/io',
'libs/iterator',
'libs/mpl',
'libs/move',
'libs/mp11',
'libs/numeric',
'libs/optional',
'libs/pool',
'libs/predef',
'libs/preprocessor',
'libs/range',
'libs/ratio',
'libs/smart_ptr',
'libs/static_assert',
'libs/system',
'libs/test',
'libs/thread',
'libs/throw_exception',
'libs/type_traits',
'libs/utility',
'libs/variant2',
'libs/winapi',
'tools/build',
'tools/boost_install',
'tools/boostdep'
]
def git_boost_steps(branch, image="alpine/git", env_win_style=False):
return [{
"name": "boost ({})".format(branch),
"image": image,
"commands": [
"git clone -b {} --depth 1 https://github.com/boostorg/boost.git boost".format(branch)
]
},
{
"name": "boost submodules",
"image": image,
"commands": [
"cd boost",
"git submodule update --init --depth 20 --jobs 8 " + " ".join(deps)
]
},
{
"name": "clone",
"image": image,
"commands": [
"cd boost/libs",
"git clone {} cobalt".format("$Env:DRONE_GIT_HTTP_URL" if env_win_style else "$DRONE_GIT_HTTP_URL"),
"cd cobalt",
"git checkout {}".format("$Env:DRONE_COMMIT" if env_win_style else "$DRONE_COMMIT")
]
}
]
def format_b2_args(**kwargs):
res = ""
for k in kwargs:
res += " {}={}".format(k.replace('_', '-'), kwargs[k])
return res
def linux_build_steps(image, privileged, **kwargs):
args = format_b2_args(**kwargs)
return [
{
"name": "bootstrap",
"image": image,
"commands": [
"cd boost",
"./bootstrap.sh"
]
},
{
"name": "build",
"image": image,
"commands" : [
"cd boost/libs/cobalt",
"../../b2 build -j8 " + args
]
},
{
"name": "test",
"image": image,
"privileged" : privileged,
"commands" : [
"echo 0 | sudo tee /proc/sys/kernel/randomize_va_space" if privileged else "echo",
"cd boost/libs/cobalt",
"../../b2 test -j8 " + args
]
}
]
def windows_build_steps(image, **kwargs):
args = format_b2_args(**kwargs)
return [
{
"name": "bootstrap",
"image": image,
"commands": [
"cd boost",
".\\\\bootstrap.bat"
]
},
{
"name" : "build",
"image" : image,
"commands": [
"cd boost/libs/cobalt",
"..\\\\..\\\\b2 build -j8 " + args
]
},
{
"name": "test",
"image": image,
"commands": [
"cd boost/libs/cobalt",
"..\\\\..\\\\b2 test -j8 " + args
]
}
]
def linux(
name,
branch,
image,
privileged = False,
**kwargs):
return {
"kind": "pipeline",
"type": "docker",
"name": name,
"clone": {"disable": True},
"platform": {
"os": "linux",
"arch": "amd64"
},
"steps": git_boost_steps(branch) + linux_build_steps(image, privileged, **kwargs)
}
def windows(
name,
branch,
image,
**kwargs):
return {
"kind": "pipeline",
"type": "docker",
"name": name,
"clone": {"disable": True},
"platform": {
"os": "windows",
"arch": "amd64"
},
"steps": git_boost_steps(branch, image, True) + windows_build_steps(image, **kwargs)
}
def main(ctx):
branch = ctx.build.branch
if ctx.build.event == 'tag' or (branch != 'master' and branch != 'refs/heads/master'):
branch = 'develop'
return [
linux("gcc-11", branch, "docker.io/library/gcc:11", variant="release", cxxstd="20"),
linux("gcc-12", branch, "docker.io/library/gcc:12.3", variant="release", cxxstd="20"),
linux("gcc-13", branch, "docker.io/library/gcc:13", variant="release", cxxstd="20"),
linux("gcc-13 (asan)", branch, "docker.io/library/gcc:13", variant="release", cxxstd="20", debug_symbols="on", address_sanitizer="on"),
linux("gcc-13 (usan)", branch, "docker.io/library/gcc:13", variant="release", cxxstd="20", debug_symbols="on", undefined_sanitizer="on"),
linux("gcc-13 (tsan)", branch, "docker.io/library/gcc:13", variant="release", cxxstd="20", debug_symbols="on", thread_sanitizer="on"),
linux("gcc-13 (io_context)", branch, "docker.io/library/gcc:13", variant="release", cxxstd="20", **{'boost.cobalt.executor': 'use_io_context'}),
linux("gcc-13 (container.pmr)", branch, "docker.io/library/gcc:13", variant="release", cxxstd="20", **{'boost.cobalt.pmr': 'boost-container'}),
linux("gcc-13 (no pmr)", branch, "docker.io/library/gcc:13", variant="release", cxxstd="20", **{'boost.cobalt.pmr': 'no'}),
linux("clang", branch, "cppalliance/droneubuntu2404:1", privileged=True, toolset='clang', variant="release", cxxstd="20"),
linux("clang (container.pmr)", branch, "cppalliance/droneubuntu2404:1", privileged=True, toolset='clang', variant="release", cxxstd="20", **{'boost.cobalt.pmr': 'boost-container'}),
linux("clang (no pmr)", branch, "cppalliance/droneubuntu2404:1", privileged=True, toolset='clang', variant="release", cxxstd="20", **{'boost.cobalt.pmr': 'no'}),
linux("clang (asan)", branch, "cppalliance/droneubuntu2404:1", privileged=True, toolset='clang', variant="release", cxxstd="20", debug_symbols="on", address_sanitizer="on"),
linux("clang (usan)", branch, "cppalliance/droneubuntu2404:1", privileged=True, toolset='clang', variant="release", cxxstd="20", debug_symbols="on", undefined_sanitizer="on"),
linux("clang (tsan)", branch, "cppalliance/droneubuntu2404:1", privileged=True, toolset='clang', variant="release", cxxstd="20", debug_symbols="on", thread_sanitizer="on"),
windows("msvc-14.3 (x64)", branch, "cppalliance/dronevs2022:latest", variant="release", cxxstd="20", address_model="64"),
windows("msvc-14.3 (x32)", branch, "cppalliance/dronevs2022:latest", variant="release", cxxstd="20", address_model="32")
]