Skip to content

Commit 5abb42f

Browse files
authored
Merge pull request #516 from moisesPompilio/issue_515
fix(ci): enforce compatible CMake version for LND tests
2 parents b00daa3 + d79d1ba commit 5abb42f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/lnd-integration.yml

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

12+
- name: Check and install CMake if needed
13+
# lnd_grpc_rust (via prost-build v0.10.4) requires CMake >= 3.5 but is incompatible with CMake >= 4.0.
14+
# This step checks if CMake is missing, below 3.5, or 4.0 or higher, and installs CMake 3.31.6 if needed,
15+
# ensuring compatibility with prost-build in ubuntu-latest.
16+
run: |
17+
if ! command -v cmake &> /dev/null ||
18+
[ "$(cmake --version | head -n1 | cut -d' ' -f3)" \< "3.5" ] ||
19+
[ "$(cmake --version | head -n1 | cut -d' ' -f3)" \> "4.0" ]; then
20+
sudo apt-get update
21+
sudo apt-get remove -y cmake
22+
wget https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-Linux-x86_64.sh
23+
echo "518c76bd18cc4ca5faab891db69b1289dc1bf134f394f0983a19576711b95210 cmake-3.31.6-Linux-x86_64.sh" | sha256sum -c - || {
24+
echo "Error: The checksum of the downloaded file does not match the expected value!"
25+
exit 1
26+
}
27+
chmod +x cmake-3.31.6-Linux-x86_64.sh
28+
sudo ./cmake-3.31.6-Linux-x86_64.sh --prefix=/usr/local --skip-license
29+
fi
30+
1231
- name: Create temporary directory for LND data
1332
id: create-temp-dir
1433
run: echo "LND_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV

0 commit comments

Comments
 (0)