3535
3636jobs :
3737 run-ubuntu-unit-tests :
38- runs-on : ubuntu-20 .04
38+ runs-on : ubuntu-22 .04
3939 timeout-minutes : 60
4040 strategy :
4141 fail-fast : false
5151 - " -DFLB_SANITIZE_THREAD=On"
5252 - " -DFLB_SIMD=On"
5353 - " -DFLB_SIMD=Off"
54+ cmake_version :
55+ - " 3.31.6"
5456 compiler :
5557 - gcc :
5658 cc : gcc
6971 - name : Setup environment
7072 run : |
7173 sudo apt-get update
72- sudo apt-get install -y gcc-7 g++-7 clang-6.0 libsystemd-dev gcovr libyaml-dev libbpf-dev linux-tools-common
73- sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true
74+ sudo apt-get install -y gcc-9 g++-9 clang-12 libsystemd-dev gcovr libyaml-dev libbpf-dev linux-tools-common
75+ sudo ln -s /usr/bin/llvm-symbolizer-12 /usr/bin/llvm-symbolizer || true
76+
77+ - name : Install cmake
78+ uses : jwlawson/actions-setup-cmake@v2
79+ with :
80+ cmake-version : " ${{ matrix.cmake_version }}"
7481
7582 - uses : actions/checkout@v4
7683
8289 - name : ${{ matrix.compiler.cc }} & ${{ matrix.compiler.cxx }} - ${{ matrix.flb_option }}
8390 run : |
8491 echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
85- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
86- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
87- sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90
92+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90
93+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 90
94+ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 90
8895 sudo usermod -a -G systemd-journal $(id -un)
8996 sudo -E su -p $(id -un) -c "PATH=$PATH ci/scripts/run-unit-tests.sh"
9097 env :
@@ -106,9 +113,16 @@ jobs:
106113 - " -DFLB_JEMALLOC=Off"
107114 - " -DFLB_SANITIZE_MEMORY=On"
108115 - " -DFLB_SANITIZE_THREAD=On"
116+ cmake_version :
117+ - " 3.31.6"
109118 permissions :
110119 contents : read
111120 steps :
121+ - name : Install cmake
122+ uses : jwlawson/actions-setup-cmake@v2
123+ with :
124+ cmake-version : " ${{ matrix.cmake_version }}"
125+
112126 - uses : actions/checkout@v4
113127 - uses : actions/checkout@v4
114128 with :
@@ -144,15 +158,29 @@ jobs:
144158 unit_test_option : " -DFLB_TESTS_INTERNAL=On"
145159 compiler_cc : gcc
146160 compiler_cxx : g++
161+ cmake_version : " 3.31.6"
162+ cmake_home : " /opt/cmake"
163+
147164 steps :
148165 - name : Checkout Fluent Bit code
149166 uses : actions/checkout@v4
150167
151168 - name : Setup environment
152169 run : |
153170 sudo apt-get update
154- sudo apt-get install -y gcc-9 g++-9 clang-12 cmake flex bison libsystemd-dev gcovr libyaml-dev libbpf-dev linux-tools-common
171+ sudo apt-get install -y gcc-9 g++-9 clang-12 flex bison libsystemd-dev gcovr libyaml-dev libbpf-dev linux-tools-common curl tar gzip
155172 sudo ln -s /usr/bin/llvm-symbolizer-12 /usr/bin/llvm-symbolizer || true
173+ sudo mkdir -p "${CMAKE_HOME}"
174+ cmake_url="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-$(uname -m).tar.gz"
175+ cmake_dist="$(mktemp --suffix ".tar.gz")"
176+ echo "Downloading CMake ${CMAKE_VERSION}: ${cmake_url} -> ${cmake_dist}"
177+ curl -jksSL -o "${cmake_dist}" "${cmake_url}"
178+ echo "Extracting CMake ${CMAKE_VERSION}: ${cmake_dist} -> ${CMAKE_HOME}"
179+ sudo tar -xzf "${cmake_dist}" -C "${CMAKE_HOME}" --strip-components 1
180+ rm "${cmake_dist}"
181+ env :
182+ CMAKE_HOME : ${{ matrix.config.cmake_home }}
183+ CMAKE_VERSION : ${{ matrix.config.cmake_version }}
156184
157185 - name : Build and test with arm runners
158186 run : |
@@ -169,6 +197,10 @@ jobs:
169197
170198 echo "CC = ${{ matrix.config.compiler_cc }}, CXX = ${{ matrix.config.compiler_cxx }}, FLB_OPT = $FLB_OPT"
171199
200+ if [[ -n "${CMAKE_HOME}" ]]; then
201+ export PATH="${CMAKE_HOME}/bin:${PATH}"
202+ fi
203+
172204 cmake ${FLB_OPT} ../
173205 make -j $nparallel
174206 ctest -j $nparallel --build-run-dir . --output-on-failure
@@ -177,12 +209,13 @@ jobs:
177209 CC : ${{ matrix.config.compiler_cc }}
178210 CXX : ${{ matrix.config.compiler_cxx }}
179211 CALYPTIA_FLEET_TOKEN : ${{ secrets.CALYPTIA_FLEET_TOKEN }}
212+ CMAKE_HOME : ${{ matrix.config.cmake_home }}
180213
181214 run-qemu-ubuntu-unit-tests :
182215 # We chain this after Linux one as there are CPU time costs for QEMU emulation
183216 needs :
184217 - run-ubuntu-unit-tests
185- runs-on : ubuntu-20 .04
218+ runs-on : ubuntu-22 .04
186219 timeout-minutes : 60
187220 strategy :
188221 fail-fast : false
@@ -206,7 +239,8 @@ jobs:
206239 --volume "/etc/machine-id:/etc/machine-id"
207240 install : |
208241 apt-get update
209- apt-get install -y gcc-12 g++-12 libyaml-dev cmake flex bison libssl-dev libbpf-dev linux-tools-common
242+ apt-get install -y gcc-12 g++-12 libyaml-dev flex bison libssl-dev libbpf-dev linux-tools-common
243+ apt-get satisfy -y cmake "cmake (<< 4.0)"
210244
211245 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90
212246 update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 90
0 commit comments