Skip to content

Commit 2da648e

Browse files
committed
ci: Add macos.yaml using the build-cln.yaml flow
1 parent d7e664e commit 2da648e

File tree

2 files changed

+53
-28
lines changed

2 files changed

+53
-28
lines changed

.github/workflows/build-cln.yaml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ on:
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

3540
env:
3641
RUST_PROFILE: release
@@ -39,7 +44,7 @@ env:
3944
jobs:
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

@@ -69,9 +85,25 @@ jobs:
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
@@ -83,7 +115,8 @@ jobs:
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

.github/workflows/macos.yaml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22
name: Mac OS pytest
33
on:
44
pull_request:
5+
workflow_dispatch:
56
jobs:
7+
build-macos:
8+
name: Build CLN (macOS)
9+
uses: ./.github/workflows/build-cln.yaml
10+
with:
11+
cfg: macos-clang
12+
compiler: clang
13+
os: macos-14
14+
615
smoke-test:
716
name: Smoke Test macOS
817
runs-on: macos-14
918
timeout-minutes: 120
19+
needs:
20+
- build-macos
1021
strategy:
1122
fail-fast: true
1223
matrix:
@@ -25,32 +36,13 @@ jobs:
2536
sudo mv bitcoin-${BITCOIND_VERSION}/bin/* /usr/local/bin
2637
rm -rf bitcoin-${BITCOIND_VERSION}-${TARGET_ARCH}.tar.gz bitcoin-${BITCOIND_VERSION}
2738
28-
- name: Set up Python 3.10
29-
uses: actions/setup-python@v5
39+
- name: Download build
40+
uses: actions/download-artifact@v4
3041
with:
31-
python-version: "3.10"
32-
33-
- name: Install uv
34-
uses: astral-sh/setup-uv@v5
35-
36-
- name: Install dependencies
37-
run: |
38-
export PATH="/usr/local/opt:/Users/runner/.local/bin:/opt/homebrew/bin/python3.10/bin:$PATH"
39-
40-
brew install gnu-sed autoconf automake libtool protobuf openssl lowdown libsodium
41-
42-
# https://github.com/grpc/grpc/issues/31737#issuecomment-1323796842
43-
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
44-
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
45-
uv sync --all-groups
46-
47-
- name: Build and install CLN
48-
run: |
49-
export CPATH=/opt/homebrew/include
50-
export LIBRARY_PATH=/opt/homebrew/lib
42+
name: cln-macos-clang.tar.bz2
5143

52-
uv run ./configure --disable-valgrind --disable-compat
53-
uv run make
44+
- name: Unpack CLN
45+
run: tar -xaf cln-macos-clang.tar.bz2
5446

5547
- name: Start bitcoind in regtest mode
5648
run: |

0 commit comments

Comments
 (0)