Skip to content

Commit

Permalink
macos: fix ci and autoclean
Browse files Browse the repository at this point in the history
Changelog-None
  • Loading branch information
daywalker90 committed Jul 31, 2024
1 parent 5c49448 commit a262260
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
58 changes: 28 additions & 30 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Mac OS pytest
on:
push:
branches:
- "master"
pull_request:
jobs:
smoke-test:
Expand All @@ -9,51 +12,46 @@ jobs:
timeout-minutes: 120
strategy:
fail-fast: true
matrix:
bitcoind-version: ["27.1"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache bitcoind
id: cache-bitcoind
uses: actions/cache@v4
with:
path: /usr/local/bin/bitcoin*
key: cache-bitcoind-${{ matrix.bitcoind-version }}-macos-arm64

- name: Download Bitcoin ${{ matrix.bitcoind-version }} & install binaries
if: ${{ steps.cache-bitcoind.outputs.cache-hit != 'true' }}
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: Install dependencies
run: |
export PATH="/usr/local/opt:/Users/runner/.local/bin:/Users/runner/Library/Python/3.10/bin:$PATH"
export BITCOIN_VERSION=27.1
brew install wget autoconf automake libtool python@3.10 gnu-sed gettext libsodium
(
cd /tmp/
wget https://storage.googleapis.com/c-lightning-tests/bitcoin-$BITCOIN_VERSION-osx64.tar.gz -O bitcoin.tar.gz
tar -xvzf bitcoin.tar.gz
sudo mv bitcoin-$BITCOIN_VERSION/bin/* /usr/local/bin
)
brew install wget autoconf automake libtool python@3.10 gnu-sed gettext libsodium protobuf
python3.10 -m pip install -U --user poetry wheel pip
python3.10 -m poetry install
python3.10 -m pip install -U --user mako
ln -s /usr/local/Cellar/gettext/0.20.1/bin/xgettext /usr/local/opt
sudo ln -s /usr/local/Cellar/gettext/0.20.1/bin/xgettext /usr/local/opt
- name: Build
env:
PYTEST_PAR: ${{ matrix.PYTEST_PAR }}
PYTEST_OPTS: ${{ matrix.PYTEST_OPTS }}
NO_PYTHON: ${{ matrix.NO_PYTHON }}
COPTFLAGS: ${{ matrix.COPTFLAGS }}
NETWORK: ${{ matrix.NETWORK }}
TEST_CMD: ${{ matrix.TEST_CMD }}
TEST_GROUP_COUNT: ${{ matrix.TEST_GROUP_COUNT }}
TEST_GROUP: ${{ matrix.TEST_GROUP }}
run: |
export PATH="/usr/local/opt:/Users/runner/.local/bin:/Users/runner/Library/Python/3.10/bin:/usr/local/opt:$PATH"
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
cat << EOF > pytest.ini
[pytest]
addopts=-p no:logging --color=yes --timeout=600 --timeout-method=thread --test-group-random-seed=42 --junitxml=report.xml --json-report --json-report-file=report.json --json-report-indent=2
markers =
slow_test: marks tests as slow (deselect with '-m "not slow_test"')
EOF
export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib
python3.10 -m poetry run ./configure --disable-valgrind --disable-compat
python3.10 -m poetry run make
2 changes: 1 addition & 1 deletion plugins/autoclean.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static struct command_result *clean_finished(struct clean_info *cinfo)
if (!num_cleaned)
continue;

plugin_log(plugin, LOG_DBG, "cleaned %"PRIu64" from %s",
plugin_log(plugin, LOG_DBG, "cleaned %zu from %s",
num_cleaned, subsystem_to_str(&sv));
*total_cleaned(&sv) += num_cleaned;
jsonrpc_set_datastore_string(plugin, cinfo->cmd,
Expand Down

0 comments on commit a262260

Please sign in to comment.