3131 required : false
3232 type : string
3333 default : ' '
34+ os :
35+ description : ' Operating system (ubuntu-22.04 or macos-14)'
36+ required : false
37+ type : string
38+ default : ' ubuntu-22.04'
3439
3540env :
3641 RUST_PROFILE : release
3944jobs :
4045 build :
4146 name : Build CLN ${{ inputs.cfg }}
42- runs-on : ubuntu-22.04
47+ runs-on : ${{ inputs.os }}
4348 timeout-minutes : 30
4449 steps :
4550 - name : Checkout
@@ -53,10 +58,21 @@ jobs:
5358 - name : Install uv
5459 uses : astral-sh/setup-uv@v5
5560
56- - name : Install dependencies
61+ - name : Install dependencies (Linux)
62+ if : ${{ inputs.os == 'ubuntu-22.04' }}
5763 run : |
5864 bash -x .github/scripts/setup.sh
5965
66+ - name : Install dependencies (macOS)
67+ if : ${{ startsWith(inputs.os, 'macos-') }}
68+ env :
69+ GRPC_PYTHON_BUILD_SYSTEM_OPENSSL : 1
70+ GRPC_PYTHON_BUILD_SYSTEM_ZLIB : 1
71+ run : |
72+ export PATH="/usr/local/opt:/Users/runner/.local/bin:/opt/homebrew/bin/python3.10/bin:$PATH"
73+ brew install gnu-sed autoconf automake libtool protobuf openssl lowdown libsodium
74+ uv sync --all-groups
75+
6076 - name : Setup sccache
6177 uses :
mozilla-actions/[email protected] 6278
6985 COMPAT : 1
7086 CFG : ${{ inputs.cfg }}
7187 RUSTC_WRAPPER : sccache
88+ # macOS-specific environment variables
89+ CPATH : ${{ startsWith(inputs.os, 'macos-') && '/opt/homebrew/include' || '' }}
90+ LIBRARY_PATH : ${{ startsWith(inputs.os, 'macos-') && '/opt/homebrew/lib' || '' }}
91+ GRPC_PYTHON_BUILD_SYSTEM_OPENSSL : ${{ startsWith(inputs.os, 'macos-') && '1' || '' }}
92+ GRPC_PYTHON_BUILD_SYSTEM_ZLIB : ${{ startsWith(inputs.os, 'macos-') && '1' || '' }}
7293 run : |
7394 set -e
74- ./configure --enable-debugbuild CC="sccache $COMPILER" ${{ inputs.coptflags }}
95+
96+ # Determine configure flags based on OS
97+ if [[ "${{ inputs.os }}" == ubuntu-* ]]; then
98+ CONFIGURE_FLAGS="--enable-debugbuild"
99+ CC_WRAPPER="sccache $COMPILER"
100+ else
101+ # macOS: disable valgrind (not available) and compat
102+ CONFIGURE_FLAGS="--disable-valgrind --disable-compat"
103+ CC_WRAPPER="$COMPILER"
104+ fi
105+
106+ ./configure $CONFIGURE_FLAGS CC="$CC_WRAPPER" ${{ inputs.coptflags }}
75107
76108 uv run make -j $(nproc) testpack.tar.bz2
77109
83115 RUSTC_WRAPPER : sccache
84116 run : cargo test --all
85117
86- - uses : actions/upload-artifact@v4
118+ - name : Upload artifact
119+ uses : actions/upload-artifact@v4
87120 with :
88121 name : cln-${{ inputs.cfg }}.tar.bz2
89122 path : cln-${{ inputs.cfg }}.tar.bz2
0 commit comments