Skip to content

Commit 9742ff0

Browse files
fix(ci): ensure CMake >= 3.5 is installed for lnd_grpc_rust tests
Add a step to the CI workflow to check and install CMake if it’s missing or below version 3.5. This fixes the build failure in the LND integration tests caused by prost-build v0.10.4, which requires CMake >= 3.5. Since ubuntu-latest is not a fixed version, this ensures compatibility with potential future changes in the runner environment. Closes lightningdevkit#515
1 parent a6cb7a3 commit 9742ff0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/lnd-integration.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ jobs:
99
- name: Checkout repository
1010
uses: actions/checkout@v4
1111

12+
- name: Verify CMake version
13+
run: cmake --version
14+
15+
- name: Check and install CMake if needed
16+
# lnd_grpc_rust (via prost-build v0.10.4) requires CMake >= 3.5 but is incompatible with CMake >= 4.0.
17+
# This step checks if CMake is missing, below 3.5, or 4.0 or higher, and installs CMake 3.31.5 if needed,
18+
# ensuring compatibility with prost-build in ubuntu-latest.
19+
run: |
20+
if ! command -v cmake &> /dev/null ||
21+
[ "$(cmake --version | head -n1 | cut -d' ' -f3)" \< "3.5" ] ||
22+
[ "$(cmake --version | head -n1 | cut -d' ' -f3)" \> "4.0" ]; then
23+
sudo apt-get update
24+
sudo apt-get remove -y cmake
25+
wget https://github.com/Kitware/CMake/releases/download/v3.31.5/cmake-3.31.5-Linux-x86_64.sh
26+
chmod +x cmake-3.31.5-Linux-x86_64.sh
27+
sudo ./cmake-3.31.5-Linux-x86_64.sh --prefix=/usr/local --skip-license
28+
fi
29+
1230
- name: Create temporary directory for LND data
1331
id: create-temp-dir
1432
run: echo "LND_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV

0 commit comments

Comments
 (0)