Skip to content

CI: Update Mac CI to use gmake #7138

CI: Update Mac CI to use gmake

CI: Update Mac CI to use gmake #7138

Workflow file for this run

---
name: Mac OS pytest
on:
pull_request:
jobs:
smoke-test:
name: Smoke Test macOS
runs-on: macos-14
timeout-minutes: 120
strategy:
fail-fast: true
matrix:
bitcoind-version: ["27.1"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Bitcoin ${{ matrix.bitcoind-version }} & install binaries
run: |
export BITCOIND_VERSION=${{ matrix.bitcoind-version }}
export TARGET_ARCH="arm64-apple-darwin"
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIND_VERSION}/bitcoin-${BITCOIND_VERSION}-${TARGET_ARCH}.tar.gz
tar -xzf bitcoin-${BITCOIND_VERSION}-${TARGET_ARCH}.tar.gz
sudo mv bitcoin-${BITCOIND_VERSION}/bin/* /usr/local/bin
rm -rf bitcoin-${BITCOIND_VERSION}-${TARGET_ARCH}.tar.gz bitcoin-${BITCOIND_VERSION}
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: |
export PATH="/usr/local/opt:/Users/runner/.local/bin:/opt/homebrew/bin/python3.10/bin:$PATH"
brew install gnu-sed autoconf automake libtool protobuf openssl lowdown libsodium make
# Fix llvm@15 libunwind re-export path mismatch (Homebrew packaging bug)
LIBUNWIND="$(find /opt/homebrew/Cellar/llvm@15 -name 'libunwind.1.0.dylib' 2>/dev/null | head -1)"
if [ -n "$LIBUNWIND" ]; then
LLVM_LIB_DIR="$(dirname "$LIBUNWIND")"
install_name_tool -id "$LLVM_LIB_DIR/libunwind.1.dylib" "$LIBUNWIND"
# Also patch the parent lib that re-exports libunwind
PARENT="$(find "$LLVM_LIB_DIR" -name 'libunwind.dylib' -o -name 'libc++.1.dylib' 2>/dev/null)"
for lib in $PARENT; do
install_name_tool -change \
"/opt/homebrew/opt/llvm@15/lib/libunwind.1.dylib" \
"$LIBUNWIND" \
"$lib" 2>/dev/null || true
done
fi
# https://github.com/grpc/grpc/issues/31737#issuecomment-1323796842
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
uv sync --all-groups
- name: Build and install CLN
run: |
export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib
export CFLAGS="-Wno-error=unused-command-line-argument"
uv run ./configure --disable-valgrind --disable-compat
uv run gmake
- name: Start bitcoind in regtest mode
run: |
bitcoind -regtest -daemon
sleep 5
- name: Generate initial block
run: |
bitcoin-cli -regtest createwallet default_wallet
bitcoin-cli -regtest generatetoaddress 1 $(bitcoin-cli -regtest getnewaddress)
sleep 2
- name: Start CLN in regtest mode
run: |
lightningd/lightningd --network=regtest --log-file=/tmp/l1.log --daemon
sleep 5
- name: Verify CLN is running
run: |
cli/lightning-cli --regtest getinfo