Skip to content

Commit

Permalink
workflows: Use g++ or clang++ for C++ source buildings and linkings
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
  • Loading branch information
cosmo0920 committed Oct 7, 2024
1 parent f385c65 commit d1b404a
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ jobs:
- "-DFLB_SANITIZE_MEMORY=On"
- "-DFLB_SANITIZE_THREAD=On"
compiler:
- gcc
- clang
- gcc:
cc: gcc
cxx: g++
- clang:
cc: clang
cxx: clang++
exclude:
- flb_option: "-DFLB_COVERAGE=On"
compiler: clang

Check failure on line 54 in .github/workflows/unit-tests.yaml

View workflow job for this annotation

GitHub Actions / PR - Actionlint

value "clang" in "exclude" does not match in matrix "compiler" combinations. possible values are {"cc": "gcc", "cxx": "g++", "gcc": ""}, {"cc": "clang", "clang": "", "cxx": "clang++"}
Expand All @@ -64,7 +68,7 @@ jobs:
repository: calyptia/fluent-bit-ci
path: ci

- name: ${{ matrix.compiler }} - ${{ matrix.flb_option }}
- name: ${{ matrix.compiler.cc }} & ${{ matrix.compiler.cxx }} - ${{ matrix.flb_option }}
run: |
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
Expand All @@ -73,8 +77,8 @@ jobs:
sudo usermod -a -G systemd-journal $(id -un)
sudo -E su -p $(id -un) -c "PATH=$PATH ci/scripts/run-unit-tests.sh"
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compiler }}
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
FLB_OPT: ${{ matrix.flb_option }}

run-macos-unit-tests:
Expand Down Expand Up @@ -128,7 +132,9 @@ jobs:
omit_option: "-DFLB_WITHOUT_flb-it-utils=1 -DFLB_WITHOUT_flb-it-pack=1"
global_option: "-DFLB_BACKTRACE=Off -DFLB_SHARED_LIB=Off -DFLB_DEBUG=On -DFLB_ALL=On -DFLB_EXAMPLES=Off"
unit_test_option: "-DFLB_TESTS_INTERNAL=On"
compiler: gcc
compiler:
cc: gcc
cxx: g++
steps:
- name: Checkout Fluent Bit code
uses: actions/checkout@v4
Expand Down Expand Up @@ -163,8 +169,8 @@ jobs:
ctest -j $nparallel --build-run-dir . --output-on-failure
working-directory: build
env:
CC: ${{ matrix.config.compiler }}
CXX: ${{ matrix.config.compiler }}
CC: ${{ matrix.config.compiler.cc }}
CXX: ${{ matrix.config.compiler.cxx }}

run-qemu-ubuntu-unit-tests:
# We chain this after Linux one as there are CPU time costs for QEMU emulation
Expand Down Expand Up @@ -208,7 +214,7 @@ jobs:
export FLB_UNIT_TEST_OPTION="-DFLB_TESTS_INTERNAL=On"
export FLB_OPT="${FLB_OPTION} ${GLOBAL_OPTION} ${FLB_UNIT_TEST_OPTION} ${FLB_OMIT_OPTION}"
export CC=gcc
export CXX=gcc
export CXX=g++
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
Expand Down

0 comments on commit d1b404a

Please sign in to comment.