-
Notifications
You must be signed in to change notification settings - Fork 1.6k
80 lines (73 loc) · 2.75 KB
/
pr-compile-check.yaml
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
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@v4
- 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: ubuntu-20.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
flb_option:
- "-DFLB_PREFER_SYSTEM_LIBS=On"
compiler:
- gcc
- clang
steps:
- name: Setup environment
run: |
sudo apt-get update
sudo apt-get install -y curl gcc-7 g++-7 clang-6.0 libsystemd-dev gcovr libyaml-dev libluajit-5.1-dev \
libnghttp2-dev libjemalloc-dev
sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true
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: Checkout Fluent Bit code
uses: actions/checkout@v4
- name: ${{ matrix.compiler }} - ${{ 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-7 90
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90
cmake $GLOBAL_OPTS $FLB_OPT ../
make -j $nparallel
working-directory: build
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compiler }}
FLB_OPT: ${{ matrix.flb_option }}
GLOBAL_OPTS: "-DFLB_JEMALLOC=On -DFLB_SHARED_LIB=Off -DFLB_DEBUG=On -DFLB_ALL=On -DFLB_EXAMPLES=Off"
- name: Display dependencies w/ ldd
run: |
ldd ./bin/fluent-bit
working-directory: build