Skip to content

Commit d00ac8c

Browse files
authored
chore: update to coverage (#1285)
Github action fails because the runner's minimum supported version for CMAKE is 3.5 whereas the minimum version mentioned in `librdkafka` is 3.2 This PR introduces a (hopefully temporary) change which fetches the crates and modifies the `CMakeLists.txt` of `librdkafka` before installation
1 parent 40876cd commit d00ac8c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/coverage.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,34 @@ jobs:
3333
pkg-config \
3434
build-essential
3535
if: runner.os == 'Linux'
36+
37+
- name: Find and fix librdkafka CMakeLists.txt
38+
run: |
39+
# Download the package first so it's in the registry
40+
cargo fetch
41+
42+
# Find the rdkafka-sys package directory
43+
RDKAFKA_SYS_DIR=$(find ~/.cargo/registry/src -name "rdkafka-sys-*" -type d | head -n 1)
44+
echo "Found rdkafka-sys at: $RDKAFKA_SYS_DIR"
45+
46+
# Find the librdkafka CMakeLists.txt file
47+
CMAKE_FILE="$RDKAFKA_SYS_DIR/librdkafka/CMakeLists.txt"
48+
49+
if [ -f "$CMAKE_FILE" ]; then
50+
echo "Found CMakeLists.txt at: $CMAKE_FILE"
51+
52+
# Make a backup of the original file
53+
cp "$CMAKE_FILE" "$CMAKE_FILE.bak"
54+
55+
# Replace the minimum required version
56+
sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
57+
58+
echo "Modified CMakeLists.txt - before and after comparison:"
59+
diff "$CMAKE_FILE.bak" "$CMAKE_FILE" || true
60+
else
61+
echo "Could not find librdkafka CMakeLists.txt file!"
62+
exit 1
63+
fi
3664
3765
- name: Check with clippy
3866
env:

0 commit comments

Comments
 (0)