Skip to content

Commit a96286e

Browse files
committed
ci: frozen version of CMake for Linux aarch64 builds to avoid issues with third-party library CMake projects not compatible with CMake 4.0 (actions/runner-images#11926).
Signed-off-by: Marat Abrarov <[email protected]>
1 parent b04fa58 commit a96286e

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/unit-tests.yaml

+20-3
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ jobs:
158158
unit_test_option: "-DFLB_TESTS_INTERNAL=On"
159159
compiler_cc: gcc
160160
compiler_cxx: g++
161-
cmake_version_max_exclusive: "4.0"
161+
cmake_version: "3.31.6"
162+
cmake_platform: "linux-aarch64"
163+
cmake_home: "/opt/cmake"
162164

163165
steps:
164166
- name: Checkout Fluent Bit code
@@ -167,9 +169,19 @@ jobs:
167169
- name: Setup environment
168170
run: |
169171
sudo apt-get update
170-
sudo apt-get install -y gcc-9 g++-9 clang-12 flex bison libsystemd-dev gcovr libyaml-dev libbpf-dev linux-tools-common
171-
sudo apt-get satisfy -y cmake "cmake (<< ${{ matrix.config.cmake_version_max_exclusive }})"
172+
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
172173
sudo ln -s /usr/bin/llvm-symbolizer-12 /usr/bin/llvm-symbolizer || true
174+
sudo mkdir -p "${CMAKE_HOME}"
175+
cmake_url="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${CMAKE_PLATFORM}.tar.gz"
176+
cmake_dist="$(mktemp --suffix ".tar.gz")"
177+
echo "Downloading CMake ${CMAKE_VERSION}: ${cmake_url} -> ${cmake_dist}"
178+
curl -jksSL -o "${cmake_dist}" "${cmake_url}"
179+
echo "Extracting CMake ${CMAKE_VERSION}: ${cmake_dist} -> ${CMAKE_HOME}"
180+
sudo tar -xzf "${cmake_dist}" -C "${CMAKE_HOME}" --strip-components 1
181+
env:
182+
CMAKE_HOME: ${{ matrix.config.cmake_home }}
183+
CMAKE_VERSION: ${{ matrix.config.cmake_version }}
184+
CMAKE_PLATFORM: ${{ matrix.config.cmake_platform }}
173185

174186
- name: Build and test with arm runners
175187
run: |
@@ -185,6 +197,10 @@ jobs:
185197
export FLB_OPT="${FLB_OPTION} ${GLOBAL_OPTION} ${FLB_UNIT_TEST_OPTION} ${FLB_OMIT_OPTION}"
186198
187199
echo "CC = ${{ matrix.config.compiler_cc }}, CXX = ${{ matrix.config.compiler_cxx }}, FLB_OPT = $FLB_OPT"
200+
201+
if [[ -n "${CMAKE_HOME}" ]]; then
202+
export PATH="${CMAKE_HOME}/bin:${PATH}"
203+
fi
188204
189205
cmake ${FLB_OPT} ../
190206
make -j $nparallel
@@ -194,6 +210,7 @@ jobs:
194210
CC: ${{ matrix.config.compiler_cc }}
195211
CXX: ${{ matrix.config.compiler_cxx }}
196212
CALYPTIA_FLEET_TOKEN: ${{ secrets.CALYPTIA_FLEET_TOKEN }}
213+
CMAKE_HOME: ${{ matrix.config.cmake_home }}
197214

198215
run-qemu-ubuntu-unit-tests:
199216
# We chain this after Linux one as there are CPU time costs for QEMU emulation

0 commit comments

Comments
 (0)