-
Notifications
You must be signed in to change notification settings - Fork 50
286 lines (257 loc) · 10.5 KB
/
ci.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
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# Copyright 2020-2021 Peter Dimov
# Copyright 2021 Andrey Semashev
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
name: CI
on:
pull_request:
branches:
- master
- develop
- feature/**
push:
branches:
- '*'
tags:
- "boost-*.*.*"
concurrency:
group: ${{format('{0}:{1}', github.repository, github.ref)}}
cancel-in-progress: true
env:
GIT_FETCH_JOBS: 8
NET_RETRY_COUNT: 5
DEFAULT_BUILD_VARIANT: debug,release
jobs:
runner-selection:
runs-on: [ self-hosted, linux, x64, ubuntu-latest-aws ]
outputs:
labelmatrix: ${{ steps.aws_hosted_runners.outputs.labelmatrix }}
steps:
- name: AWS Hosted Runners
id: aws_hosted_runners
uses: cppalliance/aws-hosted-runners@v1.0.0
cpp-matrix:
needs: [runner-selection]
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)['ubuntu-latest'] }}
name: Generate Test Matrix
outputs:
matrix: ${{ steps.cpp-matrix.outputs.matrix }}
steps:
- name: Generate Test Matrix
uses: alandefreitas/cpp-actions/cpp-matrix@v1.4.1
id: cpp-matrix
with:
compilers: |
gcc >=4.8
clang >=3.8
msvc >=14.20
apple-clang *
mingw *
clang-cl *
standards: '>=11'
latest-factors: |
gcc Coverage UBSan
factors: |
gcc Asan Shared No-Threads
msvc Shared x86
clang Time-Trace
mingw Shared
trace-commands: true
build:
needs: [cpp-matrix,runner-selection]
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.cpp-matrix.outputs.matrix) }}
name: ${{ matrix.name }}
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)[matrix.runs-on] }}
container: ${{matrix.container}}
timeout-minutes: 120
steps:
- name: Clone Boost.URL
uses: actions/checkout@v3
- name: Setup C++
uses: alandefreitas/cpp-actions/setup-cpp@v1.4.1
id: setup-cpp
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}
- name: Install packages
uses: alandefreitas/cpp-actions/package-install@v1.4.1
id: package-install
with:
apt-get: ${{ matrix.install }}
- name: Clone Boost
uses: alandefreitas/cpp-actions/boost-clone@v1.4.1
id: boost-clone
with:
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
boost-dir: ../boost-source
scan-modules-dir: .
scan-modules-ignore: url
- name: Patch Boost
working-directory: ../boost-source
id: patch
shell: bash
run: |
set -xe
module=${GITHUB_REPOSITORY#*/}
echo "module=$module" >> $GITHUB_OUTPUT
workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g')
rm -r "libs/$module" || true
cd ..
mkdir boost-root || true
cp -r "boost-source"/* "boost-root"
cd boost-root
mkdir "libs/$module"
cp -r "$workspace_root"/* "libs/$module"
cxxstd=${{ matrix.cxxstd }}
latest_std=$(echo $cxxstd | awk -F ',' '{print $NF}')
echo "latest_std=$latest_std" >> $GITHUB_OUTPUT
- name: Boost CMake Workflow
uses: alandefreitas/cpp-actions/cmake-workflow@v1.4.1
with:
source-dir: ../boost-root
build-dir: __build_cmake_test__
generator: ${{ matrix.generator }}
build-type: ${{ matrix.build-type }}
build-target: tests boost_url_tests boost_url_limits boost_url_extra
run-tests: true
install-prefix: $GITHUB_WORKSPACE/.local
cxxstd: ${{ matrix.latest-cxxstd }}
cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
ccflags: ${{ matrix.ccflags }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
cxxflags: ${{ matrix.cxxflags }}
shared: ${{ matrix.shared }}
cmake-version: '>=3.15'
extra-args: ${{ format('-D Boost_VERBOSE=ON -D BOOST_INCLUDE_LIBRARIES={0} -D BOOST_URL_DISABLE_THREADS={1}', steps.patch.outputs.module, ( matrix.no-threads && 'ON' ) || 'OFF') }}
export-compile-commands: ${{ matrix.time-trace }}
package: false
package-artifact: false
ref-source-dir: ../boost-root/libs/url
- name: Subdirectory Integration Workflow
uses: alandefreitas/cpp-actions/cmake-workflow@v1.4.1
with:
source-dir: ../boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test
build-dir: __build_cmake_subdir_test__
generator: ${{ matrix.generator }}
build-type: ${{ matrix.build_type }}
cxxstd: ${{ matrix.latest-cxxstd }}
cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
ccflags: ${{ matrix.ccflags }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
cxxflags: ${{ matrix.cxxflags }}
shared: ${{ matrix.shared }}
install: false
cmake-version: '>=3.11'
extra-args: -D BOOST_CI_INSTALL_TEST=OFF
ref-source-dir: ../boost-root/libs/url/test/cmake_test
- name: Find Package Integration Workflow
uses: alandefreitas/cpp-actions/cmake-workflow@v1.4.1
with:
source-dir: ../boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test
build-dir: __build_cmake_install_test__
generator: ${{ matrix.generator }}
build-type: ${{ matrix.build-type }}
cxxstd: ${{ matrix.latest-cxxstd }}
cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
ccflags: ${{ matrix.ccflags }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
cxxflags: ${{ matrix.cxxflags }}
shared: ${{ matrix.shared }}
install: false
extra-args: -D BOOST_CI_INSTALL_TEST=ON -D CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/.local
package: false
package-artifact: false
ref-source-dir: ../boost-root/libs/url/test/cmake_test
- name: Root Project CMake Workflow
uses: alandefreitas/cpp-actions/cmake-workflow@v1.4.1
with:
source-dir: .
build-dir: __build_root_test__
generator: ${{ matrix.generator }}
build-type: ${{ matrix.build-type }}
build-target: tests boost_url_tests boost_url_limits boost_url_extra
run-tests: false
install: false
cxxstd: ${{ matrix.latest-cxxstd }}
cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
ccflags: ${{ matrix.ccflags }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
cxxflags: ${{ matrix.cxxflags }}
shared: ${{ matrix.shared }}
extra-args: -D Boost_VERBOSE=ON -D BUILD_TESTING=ON -D BOOST_SRC_DIR="../boost-root"
package: false
package-artifact: false
ref-source-dir: .
- name: Boost B2 Workflow
uses: alandefreitas/cpp-actions/b2-workflow@v1.4.1
with:
source-dir: ../boost-root
modules: url
toolset: ${{ matrix.b2-toolset }}
build-variant: ${{ matrix.build-type }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx || '' }}
cxxstd: ${{ matrix.cxxstd }}
address-model: ${{ (matrix.x86 && '32') || '64' }}
asan: ${{ matrix.asan }}
ubsan: ${{ matrix.ubsan }}
tsan: ${{ matrix.tsan }}
shared: ${{ matrix.shared }}
- name: FlameGraph
uses: alandefreitas/cpp-actions/flamegraph@v1.4.1
if: matrix.time-trace
with:
source-dir: ../boost-root/libs/url
build-dir: ../boost-root/__build_cmake_test__
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Codecov
if: ${{ matrix.coverage }}
run: |
set -x
# Generate report
gcov_tool="gcov"
if command -v "gcov-${{ steps.setup-cpp.outputs.version-major }}.${{ steps.setup-cpp.outputs.version-minor }}" &> /dev/null; then
gcov_tool="gcov"
elif command -v "gcov-${{ steps.setup-cpp.outputs.version-major }}" &> /dev/null; then
gcov_tool="gcov-${{ steps.setup-cpp.outputs.version-major }}"
fi
lcov -c -q -o "../boost-root/__build_cmake_test__/coverage.info" -d "../boost-root/__build_cmake_test__" --include "$(pwd)/../boost-root/libs/${{steps.patch.outputs.module}}/*" --gcov-tool "$gcov_tool"
# Upload to codecov
bash <(curl -s https://codecov.io/bash) -f "../boost-root/__build_cmake_test__/coverage.info"
# Summary
echo "# Coverage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "[![codecov](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA/graphs/sunburst.svg)](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Commit: [![codecov](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA/graph/badge.svg)](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Branch: [![codecov](https://codecov.io/github/$GITHUB_REPOSITORY/branch/$GITHUB_REF_NAME/graph/badge.svg)](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
changelog:
needs: [cpp-matrix,runner-selection]
defaults:
run:
shell: bash
name: Changelog Summary
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)['ubuntu-22.04'] }}
timeout-minutes: 120
steps:
- name: Clone cpp-actions
uses: actions/checkout@v3
with:
# Avoid the common API rate limit exceeded error in boostorg by including 100 latest commits in any case
fetch-depth: 100
- name: Changelog
uses: alandefreitas/cpp-actions/create-changelog@5002c2c59e172031bba5626f6dff319e86d9bda1 # v1.4.1
with:
thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
github-token: ${{ secrets.GITHUB_TOKEN }}
limit: 200
tag-pattern: 'boost-.*\..*\..*'