Skip to content

Commit 0bf4e76

Browse files
committed
B2 CI
1 parent 1d329df commit 0bf4e76

File tree

2 files changed

+86
-5
lines changed

2 files changed

+86
-5
lines changed

.github/workflows/ci.yml

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ name: CI
44
on: [push, pull_request]
55

66
jobs:
7-
windows:
8-
name: "${{matrix.generator}} ${{matrix.toolset}} Boost ${{matrix.boost_version}} ${{matrix.build_type}} ${{matrix.name_args}}"
7+
windows-cmake:
8+
name: "${{matrix.toolset}} ${{matrix.build_type}} C++${{matrix.cxxstd}}"
99
runs-on: ${{matrix.os}}
1010
defaults:
1111
run:
1212
shell: bash
1313
strategy:
14-
# fail-fast: false
14+
fail-fast: false
1515
matrix:
1616
include:
1717
- { toolset: msvc-14.2, os: windows-2019, generator: "Visual Studio 16 2019", cxxstd: '17', build-type: 'Debug' }
@@ -79,13 +79,42 @@ jobs:
7979
--toolset ${{ matrix.toolset }} \
8080
--generator "${{ matrix.generator }}"
8181
82-
posix:
82+
windows-b2:
83+
name: "${{matrix.toolset}}"
84+
runs-on: ${{matrix.os}}
85+
defaults:
86+
run:
87+
shell: bash
88+
strategy:
89+
fail-fast: false
90+
matrix:
91+
include:
92+
- { toolset: msvc-14.2, os: windows-2019 }
93+
- { toolset: msvc-14.3, os: windows-2022 }
94+
steps:
95+
- name: Checkout
96+
uses: actions/checkout@v3
97+
98+
- name: Install dependencies
99+
run: choco install openssl
100+
101+
- name: Setup Boost
102+
run: python3 tools/ci.py setup-boost --source-dir=$(pwd)
103+
104+
- name: Build and run project tests using B2
105+
run: |
106+
python3 tools/ci.py run-b2-tests \
107+
--toolset ${{ matrix.toolset }} \
108+
--cxxstd 17,20 \
109+
--variant debug,release
110+
111+
posix-cmake:
83112
defaults:
84113
run:
85114
shell: bash
86115

87116
strategy:
88-
# fail-fast: false
117+
fail-fast: false
89118
matrix:
90119
include:
91120
- { toolset: gcc-11, install: g++-11, os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', ldflags: '' }
@@ -155,3 +184,33 @@ jobs:
155184
--build-type ${{ matrix.build-type }} \
156185
--cxxstd ${{ matrix.cxxstd }} \
157186
--toolset ${{ matrix.toolset }}
187+
188+
posix-b2:
189+
defaults:
190+
run:
191+
shell: bash
192+
193+
strategy:
194+
fail-fast: false
195+
matrix:
196+
include:
197+
- { toolset: gcc-11, install: g++-11, cxxstd: "11,17,20" } # Having C++11 shouldn't break the build
198+
- { toolset: clang-14, install: clang-11, cxxstd: "17,20" }
199+
name: "${{ matrix.toolset }}"
200+
runs-on: ubuntu-22.04
201+
steps:
202+
- name: Checkout
203+
uses: actions/checkout@v3
204+
205+
- name: Install dependencies
206+
run: sudo apt-get -y install python3 ${{ matrix.install }}
207+
208+
- name: Setup Boost
209+
run: ./tools/ci.py setup-boost --source-dir=$(pwd)
210+
211+
- name: Build and run project tests using B2
212+
run: |
213+
python3 tools/ci.py run-b2-tests \
214+
--toolset ${{ matrix.toolset }} \
215+
--cxxstd ${{ matrix.cxxstd }} \
216+
--variant debug,release

tools/ci.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,22 @@ def _run_cmake_b2_find_package_tests(
278278
_run(['ctest', '--output-on-failure', '--build-config', build_type, '--no-tests=error'])
279279

280280

281+
# Builds and runs the library tests using b2
282+
def _run_b2_tests(
283+
variant: str,
284+
cxxstd: str,
285+
toolset: str
286+
):
287+
os.chdir(str(_boost_root))
288+
_run([
289+
'b2',
290+
'--abbreviate-paths',
291+
'toolset={}'.format(toolset),
292+
'cxxstd={}'.format(cxxstd),
293+
'variant={}'.format(variant),
294+
'-j4',
295+
'libs/redis/test'
296+
])
281297

282298

283299
def main():
@@ -336,6 +352,12 @@ def main():
336352
subp.add_argument('--build-shared-libs', type=_str2bool, default=False)
337353
subp.set_defaults(func=_run_cmake_b2_find_package_tests)
338354

355+
subp = subparsers.add_parser('run-b2-tests')
356+
subp.add_argument('--variant', default='debug,release')
357+
subp.add_argument('--cxxstd', default='17,20')
358+
subp.add_argument('--toolset', default='gcc')
359+
subp.set_defaults(func=_run_b2_tests)
360+
339361
args = parser.parse_args()
340362

341363
os.environ['CMAKE_BUILD_PARALLEL_LEVEL'] = '4'

0 commit comments

Comments
 (0)