Skip to content

Commit d945fda

Browse files
committed
Add Drone support
1 parent 99a953b commit d945fda

3 files changed

Lines changed: 316 additions & 0 deletions

File tree

.drone.jsonnet

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
# Copyright 2022 Peter Dimov
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# https://www.boost.org/LICENSE_1_0.txt
4+
5+
local library = "lambda2";
6+
7+
local triggers =
8+
{
9+
branch: [ "master", "develop", "feature/*" ]
10+
};
11+
12+
local ubsan = { UBSAN: '1', UBSAN_OPTIONS: 'print_stacktrace=1' };
13+
local asan = { ASAN: '1' };
14+
15+
local linux_pipeline(name, image, environment, packages = "", sources = [], arch = "amd64") =
16+
{
17+
name: name,
18+
kind: "pipeline",
19+
type: "docker",
20+
trigger: triggers,
21+
platform:
22+
{
23+
os: "linux",
24+
arch: arch
25+
},
26+
steps:
27+
[
28+
{
29+
name: "everything",
30+
image: image,
31+
environment: environment,
32+
commands:
33+
[
34+
'set -e',
35+
'uname -a',
36+
'echo $DRONE_STAGE_MACHINE',
37+
] +
38+
(if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) +
39+
(if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) +
40+
[
41+
'export LIBRARY=' + library,
42+
'./.drone/drone.sh',
43+
]
44+
}
45+
]
46+
};
47+
48+
local macos_pipeline(name, environment, xcode_version = "12.2", osx_version = "catalina", arch = "amd64") =
49+
{
50+
name: name,
51+
kind: "pipeline",
52+
type: "exec",
53+
trigger: triggers,
54+
platform: {
55+
"os": "darwin",
56+
"arch": arch
57+
},
58+
node: {
59+
"os": osx_version
60+
},
61+
steps: [
62+
{
63+
name: "everything",
64+
environment: environment + { "DEVELOPER_DIR": "/Applications/Xcode-" + xcode_version + ".app/Contents/Developer" },
65+
commands:
66+
[
67+
'export LIBRARY=' + library,
68+
'./.drone/drone.sh',
69+
]
70+
}
71+
]
72+
};
73+
74+
local windows_pipeline(name, image, environment, arch = "amd64") =
75+
{
76+
name: name,
77+
kind: "pipeline",
78+
type: "docker",
79+
trigger: triggers,
80+
platform:
81+
{
82+
os: "windows",
83+
arch: arch
84+
},
85+
"steps":
86+
[
87+
{
88+
name: "everything",
89+
image: image,
90+
environment: environment,
91+
commands:
92+
[
93+
'cmd /C .drone\\\\drone.bat ' + library,
94+
]
95+
}
96+
]
97+
};
98+
99+
[
100+
linux_pipeline(
101+
"Linux 16.04 GCC 4.8",
102+
"cppalliance/droneubuntu1604:1",
103+
{ TOOLSET: 'gcc', COMPILER: 'g++-4.8', CXXSTD: '11' },
104+
"g++-4.8",
105+
),
106+
107+
linux_pipeline(
108+
"Linux 16.04 GCC 4.9",
109+
"cppalliance/droneubuntu1604:1",
110+
{ TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '11' },
111+
"g++-4.9",
112+
),
113+
114+
linux_pipeline(
115+
"Linux 16.04 GCC 5*",
116+
"cppalliance/droneubuntu1604:1",
117+
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14' },
118+
),
119+
120+
linux_pipeline(
121+
"Linux 18.04 GCC 6",
122+
"cppalliance/droneubuntu1804:1",
123+
{ TOOLSET: 'gcc', COMPILER: 'g++-6', CXXSTD: '11,14' },
124+
"g++-6",
125+
),
126+
127+
linux_pipeline(
128+
"Linux 20.04 GCC 9* ARM64",
129+
"cppalliance/droneubuntu2004:multiarch",
130+
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' },
131+
arch="arm64",
132+
),
133+
134+
linux_pipeline(
135+
"Linux 20.04 GCC 9* S390x",
136+
"cppalliance/droneubuntu2004:multiarch",
137+
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' },
138+
arch="s390x",
139+
),
140+
141+
linux_pipeline(
142+
"Linux 24.04 GCC 13* UBSAN",
143+
"cppalliance/droneubuntu2404:1",
144+
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,20,23,2c' } + ubsan,
145+
),
146+
147+
linux_pipeline(
148+
"Linux 24.04 GCC 13* ASAN",
149+
"cppalliance/droneubuntu2404:1",
150+
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,20,23,2c' } + asan,
151+
),
152+
153+
linux_pipeline(
154+
"Linux 16.04 Clang 3.5",
155+
"cppalliance/droneubuntu1604:1",
156+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '03,11' },
157+
"clang-3.5",
158+
),
159+
160+
linux_pipeline(
161+
"Linux 16.04 Clang 3.6",
162+
"cppalliance/droneubuntu1604:1",
163+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.6', CXXSTD: '03,11,14' },
164+
"clang-3.6",
165+
),
166+
167+
linux_pipeline(
168+
"Linux 16.04 Clang 3.7",
169+
"cppalliance/droneubuntu1604:1",
170+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.7', CXXSTD: '03,11,14' },
171+
"clang-3.7",
172+
),
173+
174+
linux_pipeline(
175+
"Linux 16.04 Clang 3.8",
176+
"cppalliance/droneubuntu1604:1",
177+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.8', CXXSTD: '03,11,14' },
178+
"clang-3.8",
179+
),
180+
181+
linux_pipeline(
182+
"Linux 18.04 Clang 3.9",
183+
"cppalliance/droneubuntu1804:1",
184+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.9', CXXSTD: '03,11,14' },
185+
"clang-3.9",
186+
),
187+
188+
linux_pipeline(
189+
"Linux 18.04 Clang 4.0",
190+
"cppalliance/droneubuntu1804:1",
191+
{ TOOLSET: 'clang', COMPILER: 'clang++-4.0', CXXSTD: '03,11,14' },
192+
"clang-4.0",
193+
),
194+
195+
linux_pipeline(
196+
"Linux 18.04 Clang 5.0",
197+
"cppalliance/droneubuntu1804:1",
198+
{ TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '03,11,14' },
199+
"clang-5.0",
200+
),
201+
202+
linux_pipeline(
203+
"Linux 24.04 Clang 20 UBSAN",
204+
"cppalliance/droneubuntu2404:1",
205+
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,23,2c' } + ubsan,
206+
"clang-20",
207+
),
208+
209+
linux_pipeline(
210+
"Linux 24.04 Clang 20 ASAN",
211+
"cppalliance/droneubuntu2404:1",
212+
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,23,2c' } + asan,
213+
"clang-20",
214+
),
215+
216+
macos_pipeline(
217+
"MacOS 10.15 Xcode 12.2",
218+
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' },
219+
),
220+
221+
macos_pipeline(
222+
"MacOS 12.4 Xcode 13.2.1",
223+
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' },
224+
xcode_version = "13.2.1", osx_version = "monterey", arch = "arm64",
225+
),
226+
227+
macos_pipeline(
228+
"MacOS 12.4 Xcode 13.4.1",
229+
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' },
230+
xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64",
231+
),
232+
233+
macos_pipeline(
234+
"MacOS 14 Xcode 16.2.0",
235+
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' },
236+
xcode_version = "16.2.0", osx_version = "sonoma", arch = "arm64",
237+
),
238+
239+
windows_pipeline(
240+
"Windows VS2015 msvc-14.0",
241+
"cppalliance/dronevs2015",
242+
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest', B2_DONT_EMBED_MANIFEST: '1' },
243+
),
244+
245+
windows_pipeline(
246+
"Windows VS2017 msvc-14.1",
247+
"cppalliance/dronevs2017",
248+
{ TOOLSET: 'msvc-14.1', CXXSTD: '14,17,latest' },
249+
),
250+
251+
windows_pipeline(
252+
"Windows VS2019 msvc-14.2",
253+
"cppalliance/dronevs2019",
254+
{ TOOLSET: 'msvc-14.2', CXXSTD: '14,17,20,latest' },
255+
),
256+
257+
windows_pipeline(
258+
"Windows VS2022 msvc-14.3",
259+
"cppalliance/dronevs2022:1",
260+
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
261+
),
262+
263+
windows_pipeline(
264+
"Windows VS2026 msvc-14.5",
265+
"cppalliance/dronevs2026:1",
266+
{ TOOLSET: 'msvc-14.5', CXXSTD: '14,17,20,latest' },
267+
),
268+
]

.drone/drone.bat

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@REM Copyright 2022 Peter Dimov
2+
@REM Distributed under the Boost Software License, Version 1.0.
3+
@REM https://www.boost.org/LICENSE_1_0.txt
4+
5+
@ECHO ON
6+
7+
set LIBRARY=%1
8+
set DRONE_BUILD_DIR=%CD%
9+
10+
set BOOST_BRANCH=develop
11+
if "%DRONE_BRANCH%" == "master" set BOOST_BRANCH=master
12+
cd ..
13+
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
14+
cd boost-root
15+
git submodule update --init tools/boostdep
16+
xcopy /s /e /q %DRONE_BUILD_DIR% libs\%LIBRARY%\
17+
python tools/boostdep/depinst/depinst.py -I example %LIBRARY%
18+
cmd /c bootstrap
19+
b2 -d0 headers
20+
21+
if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
22+
if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
23+
b2 -j3 libs/%LIBRARY%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker

.drone/drone.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Copyright 2022 Peter Dimov
4+
# Distributed under the Boost Software License, Version 1.0.
5+
# https://www.boost.org/LICENSE_1_0.txt
6+
7+
set -ex
8+
export PATH=~/.local/bin:/usr/local/bin:$PATH
9+
10+
DRONE_BUILD_DIR=$(pwd)
11+
12+
BOOST_BRANCH=develop
13+
if [ "$DRONE_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi
14+
15+
cd ..
16+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
17+
cd boost-root
18+
git submodule update --init tools/boostdep
19+
cp -r $DRONE_BUILD_DIR/* libs/$LIBRARY
20+
python tools/boostdep/depinst/depinst.py -I example $LIBRARY
21+
./bootstrap.sh
22+
./b2 -d0 headers
23+
24+
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
25+
./b2 -j3 libs/$LIBRARY/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${ADDRMD:+address-model=$ADDRMD} ${UBSAN:+undefined-sanitizer=norecover debug-symbols=on} ${ASAN:+address-sanitizer=norecover debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}

0 commit comments

Comments
 (0)