Skip to content

Commit 7256406

Browse files
ThomasDevoogdtedsiper
authored andcommitted
workflows: add sanity check for compilation using system libraries to pr-compile-check.yaml
Based on #7286 (comment) (@cosmo0920). Signed-off-by: Thomas Devoogdt <[email protected]>
1 parent 999e9b8 commit 7256406

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/pr-compile-check.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,46 @@ jobs:
3030
push: false
3131
load: false
3232
provenance: false
33+
34+
# Sanity check for compilation using system libraries
35+
pr-compile-system-libs:
36+
runs-on: ubuntu-20.04
37+
timeout-minutes: 60
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
flb_option:
42+
- "-DFLB_PREFER_SYSTEM_LIBS=On"
43+
compiler:
44+
- gcc
45+
- clang
46+
steps:
47+
- name: Setup environment
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y gcc-7 g++-7 clang-6.0 libsystemd-dev gcovr libyaml-dev libluajit-5.1-dev
51+
sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true
52+
53+
- name: Checkout Fluent Bit code
54+
uses: actions/checkout@v4
55+
56+
- name: ${{ matrix.compiler }} - ${{ matrix.flb_option }}
57+
run: |
58+
export nparallel=$(( $(getconf _NPROCESSORS_ONLN) > 8 ? 8 : $(getconf _NPROCESSORS_ONLN) ))
59+
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
60+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
61+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
62+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90
63+
cmake $GLOBAL_OPTS $FLB_OPT ../
64+
make -j $nparallel
65+
working-directory: build
66+
env:
67+
CC: ${{ matrix.compiler }}
68+
CXX: ${{ matrix.compiler }}
69+
FLB_OPT: ${{ matrix.flb_option }}
70+
GLOBAL_OPTS: "-DFLB_BACKTRACE=Off -DFLB_SHARED_LIB=Off -DFLB_DEBUG=On -DFLB_ALL=On -DFLB_EXAMPLES=Off"
71+
72+
- name: Display dependencies w/ ldd
73+
run: |
74+
ldd ./bin/fluent-bit
75+
working-directory: build

0 commit comments

Comments
 (0)