Skip to content

Commit 2b12525

Browse files
committed
Adds container to matrix.
1 parent 0bcbf6d commit 2b12525

File tree

3 files changed

+100
-18
lines changed

3 files changed

+100
-18
lines changed

.github/workflows/ci.yml

Lines changed: 98 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,95 @@ jobs:
131131
fail-fast: false
132132
matrix:
133133
include:
134-
- { toolset: gcc-11, install: g++-11, os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', ldflags: '' }
135-
- { toolset: gcc-11, install: g++-11, os: ubuntu-22.04, cxxstd: '20', build-type: 'Release', ldflags: '' }
136-
- { toolset: clang-11, install: clang-11, os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', ldflags: '' }
137-
- { toolset: clang-11, install: clang-11, os: ubuntu-22.04, cxxstd: '20', build-type: 'Debug', ldflags: '' }
138-
- { toolset: clang-13, install: clang-13, os: ubuntu-22.04, cxxstd: '17', build-type: 'Release', ldflags: '' }
139-
- { toolset: clang-13, install: clang-13, os: ubuntu-22.04, cxxstd: '20', build-type: 'Release', ldflags: '' }
140-
- { toolset: clang-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', cxxflags: '-stdlib=libc++', ldflags: '-lc++' }
141-
- { toolset: clang-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxstd: '20', build-type: 'Release', cxxflags: '-stdlib=libc++', ldflags: '-lc++' }
134+
- toolset: gcc-11
135+
install: g++-11
136+
os: ubuntu-latest
137+
cxxstd: '17'
138+
build-type: 'Debug'
139+
ldflags: ''
140+
141+
- toolset: gcc-11
142+
install: g++-11
143+
os: ubuntu-22.04
144+
cxxstd: '20'
145+
build-type: 'Release'
146+
ldflags: ''
147+
148+
- toolset: clang-11
149+
install: clang-11
150+
os: ubuntu-latest
151+
container: ubuntu:22.04
152+
cxxstd: '17'
153+
build-type: 'Debug'
154+
ldflags: ''
155+
156+
- toolset: clang-11
157+
install: clang-11
158+
os: ubuntu-latest
159+
container: ubuntu:22.04
160+
cxxstd: '20'
161+
build-type: 'Debug'
162+
ldflags: ''
163+
164+
- toolset: clang-13
165+
install: clang-13
166+
os: ubuntu-latest
167+
container: ubuntu:22.04
168+
cxxstd: '17'
169+
build-type: 'Release'
170+
ldflags: ''
171+
172+
- toolset: clang-13
173+
install: clang-13
174+
os: ubuntu-latest
175+
container: ubuntu:22.04
176+
cxxstd: '20'
177+
build-type: 'Release'
178+
ldflags: ''
179+
180+
- toolset: clang-14,
181+
install: 'clang-14 libc++-14-dev libc++abi-14-dev'
182+
os: ubuntu-latest
183+
container: ubuntu:22.04
184+
cxxstd: '17'
185+
build-type: 'Debug'
186+
cxxflags: '-stdlib=libc++'
187+
ldflags: '-lc++'
188+
189+
- toolset: clang-14
190+
install: 'clang-14 libc++-14-dev libc++abi-14-dev'
191+
os: ubuntu-latest
192+
container: ubuntu:22.04
193+
cxxstd: '20'
194+
build-type: 'Release'
195+
cxxflags: '-stdlib=libc++'
196+
ldflags: '-lc++'
197+
142198
runs-on: ${{ matrix.os }}
199+
container: ${{matrix.container}}
143200
env:
144201
CXXFLAGS: ${{matrix.cxxflags}} -Wall -Wextra
145202
LDFLAGS: ${{matrix.ldflags}}
146203
CMAKE_BUILD_PARALLEL_LEVEL: 4
204+
205+
services:
206+
redis:
207+
image: redis
208+
147209
steps:
148210
- name: Checkout
149211
uses: actions/checkout@v3
150212

213+
- name: Setup container environment
214+
if: matrix.container
215+
run: |
216+
apt-get update
217+
apt-get -y install sudo python3 git g++ libssl-dev protobuf-compiler redis-server
218+
151219
- name: Install dependencies
152-
run: sudo apt-get -y install cmake protobuf-compiler redis-server python3 ${{ matrix.install }}
220+
run: |
221+
sudo apt-get update
222+
sudo apt-get -y install cmake protobuf-compiler redis-server python3 ${{ matrix.install }}
153223
154224
- name: Setup Boost
155225
run: ./tools/ci.py setup-boost --source-dir=$(pwd)
@@ -209,15 +279,30 @@ jobs:
209279
fail-fast: false
210280
matrix:
211281
include:
212-
- { toolset: gcc-11, install: g++-11, cxxstd: "11,17,20" } # Having C++11 shouldn't break the build
213-
- { toolset: clang-14, install: clang-14, cxxstd: "17,20" }
214-
runs-on: ubuntu-22.04
282+
- toolset: gcc-11
283+
install: g++-11
284+
cxxstd: "11,17,20" # Having C++11 shouldn't break the build
285+
- toolset: clang-14
286+
install: clang-14
287+
os: ubuntu-latest
288+
container: ubuntu:22.04
289+
cxxstd: "17,20"
290+
runs-on: ${{ matrix.os }}
291+
container: ${{matrix.container}}
215292
steps:
216293
- name: Checkout
217294
uses: actions/checkout@v3
218295

296+
- name: Setup container environment
297+
if: matrix.container
298+
run: |
299+
apt-get update
300+
apt-get -y install sudo python3 git g++ libssl-dev
301+
219302
- name: Install dependencies
220-
run: sudo apt-get -y install python3 ${{ matrix.install }}
303+
run: |
304+
sudo apt-get update
305+
sudo apt-get -y install python3 ${{ matrix.install }}
221306
222307
- name: Setup Boost
223308
run: ./tools/ci.py setup-boost --source-dir=$(pwd)

test/cmake_subdir_test/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ project(cmake_subdir_test LANGUAGES CXX)
55
set(BOOST_INCLUDE_LIBRARIES redis)
66

77
# Build our dependencies, so the targets Boost::xxx are defined
8-
add_subdirectory(${_BOOST_ROOT} boostorg/boost)
9-
10-
# Build our project
11-
add_subdirectory(${_BOOST_ROOT}/libs/redis boostorg/redis)
8+
add_subdirectory(../../../.. boostorg/boost)
129

1310
add_executable(main main.cpp)
1411
target_link_libraries(main PRIVATE Boost::redis)

tools/ci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _setup_boost(
115115
# Install Boost dependencies
116116
_run(["git", "config", "submodule.fetchJobs", "8"])
117117
_run(["git", "submodule", "update", "-q", "--init", "tools/boostdep"])
118-
_run(["python", "tools/boostdep/depinst/depinst.py", "--include", "example", "redis"])
118+
_run(["python3", "tools/boostdep/depinst/depinst.py", "--include", "example", "redis"])
119119

120120
# Bootstrap
121121
if _is_windows:

0 commit comments

Comments
 (0)