-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (86 loc) · 2.38 KB
/
Copy pathtest.yml
File metadata and controls
99 lines (86 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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