forked from Simplexum/python-bitcointx
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (113 loc) · 4.9 KB
/
Copy pathmain.yml
File metadata and controls
125 lines (113 loc) · 4.9 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Python-bitcointx
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
env:
LIBSECP256K1_VERSION: v0.4.0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt install libtool build-essential autotools-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install automake libtool boost pkg-config libevent
fi
if [ -z "${LIBSECP256K1_VERSION:-}" ]; then
echo "LIBSECP256K1_VERSION must not be empty" >&2
exit 1
fi
sh -c "git clone https://github.com/bitcoin/secp256k1.git /tmp/libsecp256k1 && cd /tmp/libsecp256k1 && git checkout $LIBSECP256K1_VERSION && ./autogen.sh && ./configure --disable-coverage --disable-benchmark --disable-tests --disable-exhaustive-tests --enable-module-recovery --enable-module-ecdh --enable-module-schnorrsig && make && sudo make install"
sh -c "git clone https://github.com/bitcoin/bitcoin.git /tmp/bitcoin && cd /tmp/bitcoin && git checkout v25.0 && ./autogen.sh && ./configure --without-qtdbus --without-qrencode --without-miniupnpc --disable-tests --disable-wallet --disable-zmq --with-libs --disable-util-cli --disable-util-tx --disable-util-wallet --disable-bench --without-daemon --without-gui --disable-fuzz --disable-ccache --disable-static --with-system-libsecp256k1 && make && sudo make install"
python -m pip install flake8 pytest coverage mypy typing-extensions types-contextvars
- name: Lint with flake8
shell: bash
run: ./run_flake8.sh
- name: Typecheck with mypy
shell: bash
run: ./run_mypy.sh
- name: Test with pytest
env:
LD_LIBRARY_PATH: /usr/local/lib
# The full script_assets corpus runs once in its own job below, not
# in every OS/Python cell.
run: pytest --ignore=bitcointx/tests_core/test_script_assets_full.py
script-assets-full:
name: full script_assets corpus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install libsecp256k1
run: |
if [ -z "${LIBSECP256K1_VERSION:-}" ]; then
echo "LIBSECP256K1_VERSION must not be empty" >&2
exit 1
fi
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential libtool pkg-config
git clone --depth 1 --branch "$LIBSECP256K1_VERSION" https://github.com/bitcoin/secp256k1.git /tmp/libsecp256k1
cd /tmp/libsecp256k1
./autogen.sh
./configure --disable-coverage --disable-benchmark --disable-tests --disable-exhaustive-tests --enable-module-recovery --enable-module-ecdh --enable-module-schnorrsig
make -j"$(nproc)"
sudo make install
- name: Run full corpus
env:
LD_LIBRARY_PATH: /usr/local/lib
run: |
python -m pip install pytest typing-extensions
pytest bitcointx/tests_core/test_script_assets_full.py
downstream:
name: rawBit backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install libsecp256k1
run: |
if [ -z "${LIBSECP256K1_VERSION:-}" ]; then
echo "LIBSECP256K1_VERSION must not be empty" >&2
exit 1
fi
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential libtool pkg-config
git clone --depth 1 --branch "$LIBSECP256K1_VERSION" https://github.com/bitcoin/secp256k1.git /tmp/libsecp256k1
cd /tmp/libsecp256k1
./autogen.sh
./configure --disable-coverage --disable-benchmark --disable-tests --disable-exhaustive-tests --enable-module-recovery --enable-module-ecdh --enable-module-schnorrsig
make -j"$(nproc)"
sudo make install
- name: Clone rawBit
run: git clone https://github.com/rawBit-io/rawbit.git rawbit
- name: Install rawBit with this python-bitcointx checkout
run: |
python -m pip install --upgrade pip
python -m pip install -r rawbit/requirements.txt -r rawbit/requirements-special.txt
python -m pip install --force-reinstall --no-deps "$GITHUB_WORKSPACE"
- name: Test rawBit backend
working-directory: rawbit
env:
LD_LIBRARY_PATH: /usr/local/lib
run: python -m pytest backend/tests