-
Notifications
You must be signed in to change notification settings - Fork 1.9k
154 lines (139 loc) · 5.22 KB
/
pr-compile-check.yaml
File metadata and controls
154 lines (139 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: 'Pull requests compile checks'
on:
pull_request:
# Only trigger if there is a code change or a CMake change that (could) affect code
paths:
- '**.c'
- '**.h'
- 'CMakeLists.txt'
- 'cmake/*'
workflow_dispatch:
jobs:
# Sanity check for compilation using older compiler on CentOS 7
pr-compile-centos-7:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Fluent Bit code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Attempt to build current source for CentOS 7
uses: docker/build-push-action@v6
with:
context: .
file: ./dockerfiles/Dockerfile.centos7
# No need to use after this so discard completely
push: false
load: false
provenance: false
# Sanity check for compilation using system libraries
pr-compile-system-libs:
runs-on: ${{ matrix.os.version }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
flb_option:
- "-DFLB_PREFER_SYSTEM_LIBS=On"
cmake_version:
- "3.31.6"
compiler:
- gcc:
cc: gcc
cxx: g++
- clang:
cc: clang
cxx: clang++
os:
- version: ubuntu-22.04
clang: "clang-12"
- version: ubuntu-24.04
clang: "clang-14"
steps:
- name: Setup environment for ${{ matrix.os.version }} with ${{ matrix.os.clang }}
run: |
sudo apt-get update
sudo apt-get install -y curl gcc-9 g++-9 ${CLANG_PKG} libsystemd-dev gcovr libyaml-dev
sudo ln -s /usr/bin/llvm-symbolizer-12 /usr/bin/llvm-symbolizer || true
env:
CLANG_PKG: ${{ matrix.os.clang }}
- name: Install system libraries for this test
run: |
sudo apt-get update
sudo apt-get install -y libc-ares-dev libjemalloc-dev libluajit-5.1-dev \
libnghttp2-dev libsqlite3-dev libzstd-dev libmsgpack-dev librdkafka-dev
mkdir -p /tmp/libbacktrace/build && \
curl -L https://github.com/ianlancetaylor/libbacktrace/archive/8602fda.tar.gz | \
tar --strip-components=1 -xzC /tmp/libbacktrace/ && \
pushd /tmp/libbacktrace/build && ../configure && make && sudo make install && popd
- name: Install cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: "${{ matrix.cmake_version }}"
- name: Checkout Fluent Bit code
uses: actions/checkout@v6
- name: ${{ matrix.compiler.cc }} & ${{ matrix.compiler.cxx }} - ${{ matrix.flb_option }}
run: |
export nparallel=$(( $(getconf _NPROCESSORS_ONLN) > 8 ? 8 : $(getconf _NPROCESSORS_ONLN) ))
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 90
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/${CLANG_PKG} 90
cmake $GLOBAL_OPTS $FLB_OPT ../
make -j $nparallel
working-directory: build
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
FLB_OPT: ${{ matrix.flb_option }}
GLOBAL_OPTS: "-DFLB_JEMALLOC=On -DFLB_SHARED_LIB=Off -DFLB_DEBUG=On -DFLB_ALL=On -DFLB_EXAMPLES=Off"
CLANG_PKG: ${{ matrix.os.clang }}
- name: Display dependencies w/ ldd
run: |
export ldd_result=$(ldd ./bin/fluent-bit)
echo "ldd result:"
echo "$ldd_result"
echo "$ldd_result" | grep libcares
echo "$ldd_result" | grep libjemalloc
echo "$ldd_result" | grep libluajit
echo "$ldd_result" | grep libnghttp2
echo "$ldd_result" | grep libsqlite3
echo "$ldd_result" | grep libzstd
working-directory: build
- name: Display dependencies w/ ldd for libmsgpack and librdkafka
if: matrix.os.version == 'ubuntu-24.04'
run: |
export ldd_result=$(ldd ./bin/fluent-bit)
echo "ldd result:"
echo "$ldd_result" | grep libmsgpack
echo "$ldd_result" | grep librdkafka
working-directory: build
# Sanity check for compilation w/ CXX support
pr-compile-without-cxx:
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
cmake_version:
- "3.31.6"
steps:
- name: Setup environment
run: |
sudo apt-get update
sudo apt-get install -y bison cmake flex gcc libssl-dev libyaml-dev
sudo apt-get install -y libzstd-dev librdkafka-dev
- name: Install cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: "${{ matrix.cmake_version }}"
- name: Checkout Fluent Bit code
uses: actions/checkout@v6
- name: Compile w/ CXX support
run: |
export CXX=/bin/false
export nparallel=$(( $(getconf _NPROCESSORS_ONLN) > 8 ? 8 : $(getconf _NPROCESSORS_ONLN) ))
cmake -DFLB_PREFER_SYSTEM_LIB_ZSTD=ON -DFLB_PREFER_SYSTEM_LIB_KAFKA=ON ../
make -j $nparallel
working-directory: build