Skip to content

Commit 89a2e4d

Browse files
committed
Add Drone support
1 parent 7f59439 commit 89a2e4d

3 files changed

Lines changed: 276 additions & 0 deletions

File tree

.drone.jsonnet

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
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 = "describe";
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 16.04 Clang 3.5",
129+
"cppalliance/droneubuntu1604:1",
130+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '03,11' },
131+
"clang-3.5",
132+
),
133+
134+
linux_pipeline(
135+
"Linux 16.04 Clang 3.6",
136+
"cppalliance/droneubuntu1604:1",
137+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.6', CXXSTD: '03,11,14' },
138+
"clang-3.6",
139+
),
140+
141+
linux_pipeline(
142+
"Linux 16.04 Clang 3.7",
143+
"cppalliance/droneubuntu1604:1",
144+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.7', CXXSTD: '03,11,14' },
145+
"clang-3.7",
146+
),
147+
148+
linux_pipeline(
149+
"Linux 16.04 Clang 3.8",
150+
"cppalliance/droneubuntu1604:1",
151+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.8', CXXSTD: '03,11,14' },
152+
"clang-3.8",
153+
),
154+
155+
linux_pipeline(
156+
"Linux 18.04 Clang 3.9",
157+
"cppalliance/droneubuntu1804:1",
158+
{ TOOLSET: 'clang', COMPILER: 'clang++-3.9', CXXSTD: '03,11,14' },
159+
"clang-3.9",
160+
),
161+
162+
linux_pipeline(
163+
"Linux 18.04 Clang 4.0",
164+
"cppalliance/droneubuntu1804:1",
165+
{ TOOLSET: 'clang', COMPILER: 'clang++-4.0', CXXSTD: '03,11,14' },
166+
"clang-4.0",
167+
),
168+
169+
linux_pipeline(
170+
"Linux 18.04 Clang 5.0",
171+
"cppalliance/droneubuntu1804:1",
172+
{ TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '03,11,14' },
173+
"clang-5.0",
174+
),
175+
176+
macos_pipeline(
177+
"MacOS 10.15 Xcode 12.2",
178+
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' },
179+
),
180+
181+
macos_pipeline(
182+
"MacOS 12.4 Xcode 13.2.1",
183+
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' },
184+
xcode_version = "13.2.1", osx_version = "monterey", arch = "arm64",
185+
),
186+
187+
macos_pipeline(
188+
"MacOS 12.4 Xcode 13.4.1",
189+
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' },
190+
xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64",
191+
),
192+
193+
macos_pipeline(
194+
"MacOS 14 Xcode 16.2.0",
195+
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' },
196+
xcode_version = "16.2.0", osx_version = "sonoma", arch = "arm64",
197+
),
198+
199+
windows_pipeline(
200+
"Windows VS2015 msvc-14.0",
201+
"cppalliance/dronevs2015",
202+
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest', B2_DONT_EMBED_MANIFEST: '1' },
203+
),
204+
205+
windows_pipeline(
206+
"Windows VS2017 msvc-14.1",
207+
"cppalliance/dronevs2017",
208+
{ TOOLSET: 'msvc-14.1', CXXSTD: '14,17,latest' },
209+
),
210+
211+
windows_pipeline(
212+
"Windows VS2019 msvc-14.2",
213+
"cppalliance/dronevs2019",
214+
{ TOOLSET: 'msvc-14.2', CXXSTD: '14,17,20,latest' },
215+
),
216+
217+
windows_pipeline(
218+
"Windows VS2022 msvc-14.3",
219+
"cppalliance/dronevs2022:1",
220+
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
221+
),
222+
223+
windows_pipeline(
224+
"Windows VS2026 msvc-14.5",
225+
"cppalliance/dronevs2026:1",
226+
{ TOOLSET: 'msvc-14.5', CXXSTD: '14,17,20,latest' },
227+
),
228+
]

.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)