forked from petertodd/python-bitcoinlib
-
Notifications
You must be signed in to change notification settings - Fork 19
94 lines (84 loc) · 2.86 KB
/
Copy pathmain.yml
File metadata and controls
94 lines (84 loc) · 2.86 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
name: python-bitcointx
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install tooling
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Ruff lint
run: ruff check .
- name: Ruff format check
run: ruff format --check .
- name: Mypy
run: mypy
test:
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.11", "3.12", "3.13"]
# libsecp256k1 v0.4.0 is the documented reference; v0.7.0 is included
# to ensure our compatibility shim (issue #88) keeps working.
libsecp256k1-version: ["v0.4.0", "v0.7.0"]
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 system build dependencies
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
sudo apt-get update
sudo apt-get install -y libtool build-essential autotools-dev
elif [ "$RUNNER_OS" = "macOS" ]; then
brew install automake libtool pkg-config
fi
- name: Build libsecp256k1 ${{ matrix.libsecp256k1-version }}
run: |
git clone https://github.com/bitcoin-core/secp256k1.git /tmp/libsecp256k1
cd /tmp/libsecp256k1
git checkout ${{ matrix.libsecp256k1-version }}
# v0.6.0+ uses CMake exclusively; older versions use autotools.
if [ -f autogen.sh ]; then
./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
else
cmake -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON \
-DSECP256K1_ENABLE_MODULE_ECDH=ON \
-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON \
-DSECP256K1_BUILD_TESTS=OFF \
-DSECP256K1_BUILD_BENCHMARK=OFF \
-DSECP256K1_BUILD_EXHAUSTIVE_TESTS=OFF
cmake --build build
sudo cmake --install build
fi
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Run tests
env:
LD_LIBRARY_PATH: /usr/local/lib
run: pytest -q