From d79d1ba7032953793fc5e1fa1cd91dcd4f08d59e Mon Sep 17 00:00:00 2001 From: moisesPompilio Date: Thu, 3 Apr 2025 11:09:30 -0300 Subject: [PATCH] fix(ci): enforce compatible CMake version for LND tests Ensure CMake is between 3.5 and 4.0 to prevent failures in LND integration tests caused by prost-build v0.10.4. This safeguards against version changes in ubuntu-latest. Closes #515 --- .github/workflows/lnd-integration.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/lnd-integration.yml b/.github/workflows/lnd-integration.yml index 10a29c355..219e929b1 100644 --- a/.github/workflows/lnd-integration.yml +++ b/.github/workflows/lnd-integration.yml @@ -9,6 +9,25 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Check and install CMake if needed + # lnd_grpc_rust (via prost-build v0.10.4) requires CMake >= 3.5 but is incompatible with CMake >= 4.0. + # This step checks if CMake is missing, below 3.5, or 4.0 or higher, and installs CMake 3.31.6 if needed, + # ensuring compatibility with prost-build in ubuntu-latest. + run: | + if ! command -v cmake &> /dev/null || + [ "$(cmake --version | head -n1 | cut -d' ' -f3)" \< "3.5" ] || + [ "$(cmake --version | head -n1 | cut -d' ' -f3)" \> "4.0" ]; then + sudo apt-get update + sudo apt-get remove -y cmake + wget https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-Linux-x86_64.sh + echo "518c76bd18cc4ca5faab891db69b1289dc1bf134f394f0983a19576711b95210 cmake-3.31.6-Linux-x86_64.sh" | sha256sum -c - || { + echo "Error: The checksum of the downloaded file does not match the expected value!" + exit 1 + } + chmod +x cmake-3.31.6-Linux-x86_64.sh + sudo ./cmake-3.31.6-Linux-x86_64.sh --prefix=/usr/local --skip-license + fi + - name: Create temporary directory for LND data id: create-temp-dir run: echo "LND_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV