bugfix: KernelPtr objects are owned by the user by default #28
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pytest | |
on: [ push ] | |
jobs: | |
build-bitcoinkernel: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Cache bitcoinkernel build | |
id: cache-bitcoinkernel | |
uses: actions/cache@v4 | |
with: | |
path: depend/bitcoin/build/src/kernel/libbitcoinkernel.so | |
key: ${{ runner.os }}-bitcoinkernel-${{ hashFiles('depend/bitcoin/**') }} | |
restore-keys: | | |
${{ runner.os }}-bitcoinkernel- | |
- name: Check if cache hit | |
id: cache-hit | |
run: echo "CACHE_HIT=${{ steps.cache-bitcoinkernel.outputs.cache-hit }}" >> $GITHUB_ENV | |
- name: Install build dependencies | |
if: env.CACHE_HIT != 'true' # Only install if cache was not hit | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libboost-dev cmake ninja-build | |
- name: Build bitcoinkernel library | |
if: env.CACHE_HIT != 'true' # Only build if cache was not hit | |
run: | | |
mkdir -p build | |
cd build | |
cmake .. | |
- name: Cache bitcoinkernel build | |
if: env.CACHE_HIT != 'true' # Only cache if it was built | |
uses: actions/cache@v4 | |
with: | |
path: depend/bitcoin/build/src/kernel/libbitcoinkernel.so | |
key: ${{ runner.os }}-bitcoinkernel-${{ hashFiles('depend/bitcoin/**') }} | |
- name: Set BITCOINKERNEL_LIB environment variable | |
run: echo "BITCOINKERNEL_LIB=$(pwd)/depend/bitcoin/build/src/kernel/libbitcoinkernel.so" >> $GITHUB_ENV | |
shell: bash | |
test: | |
needs: build-bitcoinkernel | |
runs-on: ubuntu-latest | |
if: ${{ success() || needs.build-bitcoinkernel.result == 'skipped' }} # Run if build succeeds or is skipped | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set BITCOINKERNEL_LIB environment variable | |
run: echo "BITCOINKERNEL_LIB=$(pwd)/depend/bitcoin/build/src/kernel/libbitcoinkernel.so" >> $GITHUB_ENV | |
shell: bash | |
- name: Restore bitcoinkernel build from cache | |
uses: actions/cache@v4 | |
with: | |
path: depend/bitcoin/build/src/kernel/libbitcoinkernel.so | |
key: ${{ runner.os }}-bitcoinkernel-${{ hashFiles('depend/bitcoin/**') }} | |
restore-keys: | | |
${{ runner.os }}-bitcoinkernel- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
pip install pytest | |
- name: Run tests with pytest | |
run: | | |
pytest |