Skip to content

Commit 4053bbd

Browse files
committed
workflows: Use g++ or clang++ for C++ source buildings and linkings
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent f385c65 commit 4053bbd

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,17 @@ jobs:
4343
- "-DFLB_SANITIZE_MEMORY=On"
4444
- "-DFLB_SANITIZE_THREAD=On"
4545
compiler:
46-
- gcc
47-
- clang
46+
- gcc:
47+
cc: gcc
48+
cxx: g++
49+
- clang:
50+
cc: clang
51+
cxx: clang++
4852
exclude:
4953
- flb_option: "-DFLB_COVERAGE=On"
50-
compiler: clang
54+
compiler:
55+
cc: clang
56+
cxx: clang++
5157
permissions:
5258
contents: read
5359
steps:
@@ -64,7 +70,7 @@ jobs:
6470
repository: calyptia/fluent-bit-ci
6571
path: ci
6672

67-
- name: ${{ matrix.compiler }} - ${{ matrix.flb_option }}
73+
- name: ${{ matrix.compiler.cc }} & ${{ matrix.compiler.cxx }} - ${{ matrix.flb_option }}
6874
run: |
6975
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
7076
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
@@ -73,8 +79,8 @@ jobs:
7379
sudo usermod -a -G systemd-journal $(id -un)
7480
sudo -E su -p $(id -un) -c "PATH=$PATH ci/scripts/run-unit-tests.sh"
7581
env:
76-
CC: ${{ matrix.compiler }}
77-
CXX: ${{ matrix.compiler }}
82+
CC: ${{ matrix.compiler.cc }}
83+
CXX: ${{ matrix.compiler.cxx }}
7884
FLB_OPT: ${{ matrix.flb_option }}
7985

8086
run-macos-unit-tests:
@@ -128,7 +134,9 @@ jobs:
128134
omit_option: "-DFLB_WITHOUT_flb-it-utils=1 -DFLB_WITHOUT_flb-it-pack=1"
129135
global_option: "-DFLB_BACKTRACE=Off -DFLB_SHARED_LIB=Off -DFLB_DEBUG=On -DFLB_ALL=On -DFLB_EXAMPLES=Off"
130136
unit_test_option: "-DFLB_TESTS_INTERNAL=On"
131-
compiler: gcc
137+
compiler:
138+
cc: gcc
139+
cxx: g++
132140
steps:
133141
- name: Checkout Fluent Bit code
134142
uses: actions/checkout@v4
@@ -163,8 +171,8 @@ jobs:
163171
ctest -j $nparallel --build-run-dir . --output-on-failure
164172
working-directory: build
165173
env:
166-
CC: ${{ matrix.config.compiler }}
167-
CXX: ${{ matrix.config.compiler }}
174+
CC: ${{ matrix.config.compiler.cc }}
175+
CXX: ${{ matrix.config.compiler.cxx }}
168176

169177
run-qemu-ubuntu-unit-tests:
170178
# We chain this after Linux one as there are CPU time costs for QEMU emulation
@@ -208,7 +216,7 @@ jobs:
208216
export FLB_UNIT_TEST_OPTION="-DFLB_TESTS_INTERNAL=On"
209217
export FLB_OPT="${FLB_OPTION} ${GLOBAL_OPTION} ${FLB_UNIT_TEST_OPTION} ${FLB_OMIT_OPTION}"
210218
export CC=gcc
211-
export CXX=gcc
219+
export CXX=g++
212220
213221
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
214222

0 commit comments

Comments
 (0)