Skip to content

Test Library

Test Library #12

Workflow file for this run

name: Test Library
on:
repository_dispatch:
types: [rgb-lib-release]
workflow_run:
workflows: ["Build and Release"]
types:
- completed
workflow_dispatch:
inputs:
bitcoin_network:
description: 'Bitcoin network (signet, testnet, regtest)'
required: false
default: 'signet'
type: string
push:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
- 'rgb-lib/**'
pull_request:
branches:
- main
jobs:
test:
name: Test (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-22.04
platform: linux-x86_64
target: x86_64-unknown-linux-gnu
- runner: ubuntu-22.04-arm
platform: linux-aarch64
target: aarch64-unknown-linux-gnu
- runner: macos-latest
platform: macosx-arm64
target: aarch64-apple-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
shell: bash
- name: Build local wheel
run: |
export PLATFORM="${{ matrix.platform }}"
poetry build -vvv
env:
PLATFORM: ${{ matrix.platform }}
shell: bash
- name: Install local wheel
run: |
pip install dist/*.whl --force-reinstall
shell: bash
- name: Run tests
env:
BITCOIN_NETWORK: ${{ inputs.bitcoin_network || 'signet' }}
MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
ACCOUNT_XPUB_VANILLA: ${{ secrets.TEST_ACCOUNT_XPUB_VANILLA }}
ACCOUNT_XPUB_COLORED: ${{ secrets.TEST_ACCOUNT_XPUB_COLORED }}
MASTER_FINGERPRINT: ${{ secrets.TEST_MASTER_FINGERPRINT }}
INDEXER_URL: ${{ secrets.TEST_INDEXER_URL }}
run: |
pip install pytest
pytest tests/ -v
shell: bash