Skip to content

Commit a621d7c

Browse files
committed
ci: add workflow test on bdk-ffi commit
1 parent 3741c06 commit a621d7c

File tree

1 file changed

+285
-0
lines changed

1 file changed

+285
-0
lines changed
Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
name: Test on BDK-FFI Latest Commit
2+
3+
on:
4+
push:
5+
branches: [ "ci/test-bdk-ffi-latest" ]
6+
workflow_dispatch:
7+
repository_dispatch:
8+
types: [ trigger-bdk-python-test ]
9+
10+
permissions: {}
11+
12+
jobs:
13+
test-bdk-ffi-latest-manylinux_2_28-x86_64-wheels:
14+
name: "Build and run unittest on Manylinux 2.28 x86_64 wheels against the latest commit on bdk-ffi"
15+
runs-on: ubuntu-24.04
16+
container:
17+
image: quay.io/pypa/manylinux_2_28_x86_64
18+
env:
19+
PLAT: manylinux_2_28_x86_64
20+
PYBIN: "/opt/python/${{ matrix.python }}/bin"
21+
strategy:
22+
matrix:
23+
python:
24+
- cp310-cp310
25+
- cp311-cp311
26+
- cp312-cp312
27+
- cp313-cp313
28+
steps:
29+
- name: "Checkout"
30+
uses: actions/checkout@v4
31+
with:
32+
submodules: recursive
33+
persist-credentials: false
34+
fetch-depth: 0
35+
36+
- name: "Configure Git safe directory"
37+
run: git config --global --add safe.directory /__w/bdk-python/bdk-python
38+
39+
- name: "Update bdk-ffi submodule to latest"
40+
run: |
41+
cd ./bdk-ffi/ \
42+
&& git fetch origin \
43+
&& git checkout master \
44+
&& git pull origin master \
45+
&& echo "Testing commit: $(git log -1 --pretty=format:'%h %s (author: %cn)')"
46+
47+
- name: "Cache"
48+
uses: actions/cache@v3
49+
with:
50+
path: |
51+
~/.cargo/registry
52+
~/.cargo/git
53+
./target
54+
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
55+
56+
- name: "Install Rust 1.84.1"
57+
uses: actions-rs/toolchain@v1
58+
with:
59+
toolchain: 1.84.1
60+
61+
- name: "Generate bdk.py and binaries"
62+
run: bash ./scripts/generate-linux.sh
63+
64+
- name: "Install build"
65+
run: ${PYBIN}/pip install build
66+
67+
- name: "Build wheel"
68+
run: ${PYBIN}/python -m build --wheel --config-setting=--build-option=--plat-name=manylinux_2_28_x86_64 --verbose
69+
70+
- name: "Install wheel"
71+
run: ${PYBIN}/pip install ./dist/*.whl
72+
73+
- name: "Run tests"
74+
run: ${PYBIN}/python -m unittest discover --start "./tests/" --pattern "test_offline_*.py" --verbose
75+
76+
- name: "Upload artifact test"
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: bdkpython-manylinux_2_28_x86_64-${{ matrix.python }}
80+
path: /home/runner/work/bdk-python/bdk-python/dist/*.whl
81+
82+
test-bdk-ffi-latest-macos-arm64-wheels:
83+
name: "Build and run unittest on macOS arm64 wheels against the latest commit on bdk-ffi"
84+
runs-on: macos-13
85+
strategy:
86+
matrix:
87+
python:
88+
- "3.10"
89+
- "3.11"
90+
- "3.12"
91+
- "3.13"
92+
steps:
93+
- name: "Checkout"
94+
uses: actions/checkout@v4
95+
with:
96+
submodules: recursive
97+
persist-credentials: false
98+
fetch-depth: 0
99+
100+
- name: "Update bdk-ffi submodule to latest"
101+
run: |
102+
cd ./bdk-ffi/ \
103+
&& git fetch origin \
104+
&& git checkout master \
105+
&& git pull origin master \
106+
&& echo "Testing commit: $(git log -1 --pretty=format:'%h %s (author: %cn)')"
107+
108+
- name: "Cache"
109+
uses: actions/cache@v3
110+
with:
111+
path: |
112+
~/.cargo/registry
113+
~/.cargo/git
114+
./target
115+
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
116+
117+
- name: "Install Python"
118+
uses: actions/setup-python@v4
119+
with:
120+
python-version: ${{ matrix.python }}
121+
122+
- name: "Generate bdk.py and binaries"
123+
run: bash ./scripts/generate-macos-arm64.sh
124+
125+
- name: "Install build"
126+
run: pip3 install build
127+
128+
- name: "Build wheel"
129+
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
130+
# see issue #350 for more information
131+
run: python3 -m build --wheel --config-setting=--build-option=--plat-name=macosx_11_0_arm64 --verbose
132+
133+
# You can't install the arm64 wheel on the CI, so we skip these steps and simply test that the wheel builds
134+
# - name: "Install wheel and run tests"
135+
# run: |
136+
# pip3 install ./dist/*.whl
137+
# python3 -m unittest discover --start "./tests/" --pattern "test_offline_*.py" --verbose
138+
139+
- name: "Upload artifact test"
140+
uses: actions/upload-artifact@v4
141+
with:
142+
name: bdkpython-macos-arm64-${{ matrix.python }}
143+
path: /Users/runner/work/bdk-python/bdk-python/dist/*.whl
144+
145+
test-bdk-ffi-latest-macos-x86_64-wheels:
146+
name: "Build and run unittest on macOS x86_64 wheels against the latest commit on bdk-ffi"
147+
runs-on: macos-13
148+
strategy:
149+
matrix:
150+
python:
151+
- "3.10"
152+
- "3.11"
153+
- "3.12"
154+
- "3.13"
155+
steps:
156+
- name: "Checkout"
157+
uses: actions/checkout@v4
158+
with:
159+
submodules: recursive
160+
persist-credentials: false
161+
fetch-depth: 0
162+
163+
- name: "Update bdk-ffi submodule to latest"
164+
run: |
165+
cd ./bdk-ffi/ \
166+
&& git fetch origin \
167+
&& git checkout master \
168+
&& git pull origin master \
169+
&& echo "Testing commit: $(git log -1 --pretty=format:'%h %s (author: %cn)')"
170+
171+
- name: "Cache"
172+
uses: actions/cache@v3
173+
with:
174+
path: |
175+
~/.cargo/registry
176+
~/.cargo/git
177+
./target
178+
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
179+
180+
- uses: actions/setup-python@v4
181+
with:
182+
python-version: ${{ matrix.python }}
183+
184+
- name: "Generate bdk.py and binaries"
185+
run: bash ./scripts/generate-macos-x86_64.sh
186+
187+
- name: "Install build"
188+
run: pip3 install build
189+
190+
- name: "Build wheel"
191+
run: python3 -m build --wheel --config-setting=--build-option=--plat-name=macosx_11_0_x86_64 --verbose
192+
193+
- name: "Install wheel"
194+
run: pip3 install ./dist/*.whl
195+
196+
- name: "Run tests"
197+
run: python3 -m unittest discover --start "./tests/" --pattern "test_offline_*.py" --verbose
198+
199+
- name: "Upload artifact test"
200+
uses: actions/upload-artifact@v4
201+
with:
202+
name: bdkpython-macos-x86_64-${{ matrix.python }}
203+
path: /Users/runner/work/bdk-python/bdk-python/dist/*.whl
204+
205+
test-bdk-ffi-latest-windows-wheels:
206+
name: "Build and run unittest on Windows wheels against the latest commit on bdk-ffi"
207+
runs-on: windows-2022
208+
strategy:
209+
matrix:
210+
python:
211+
- "3.10"
212+
- "3.11"
213+
- "3.12"
214+
- "3.13"
215+
steps:
216+
- name: "Checkout"
217+
uses: actions/checkout@v4
218+
with:
219+
submodules: recursive
220+
persist-credentials: false
221+
fetch-depth: 0
222+
223+
- name: "Update bdk-ffi submodule to latest"
224+
run: |
225+
cd ./bdk-ffi/;
226+
git fetch origin;
227+
git checkout master;
228+
git pull origin master;
229+
echo "Testing commit: $(git log -1 --pretty=format:'%h %s (author: %cn)')"
230+
231+
- name: "Cache"
232+
uses: actions/cache@v3
233+
with:
234+
path: |
235+
~/.cargo/registry
236+
~/.cargo/git
237+
./target
238+
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
239+
240+
- name: "Install Python"
241+
uses: actions/setup-python@v4
242+
with:
243+
python-version: ${{ matrix.python }}
244+
245+
- name: "Generate bdk.py and binaries"
246+
run: bash ./scripts/generate-windows.sh
247+
248+
- name: "Install build"
249+
run: pip install build
250+
251+
- name: "Build wheel"
252+
run: python -m build --wheel --verbose
253+
254+
- name: "Upload artifact test"
255+
uses: actions/upload-artifact@v4
256+
with:
257+
name: bdkpython-windows-${{ matrix.python }}
258+
path: D:\a\bdk-python\bdk-python\dist\*.whl
259+
260+
- name: "Install dependencies"
261+
run: Get-ChildItem 'D:\a\bdk-python\bdk-python\dist\*.whl' | ForEach-Object {pip install $_.FullName}
262+
shell: powershell
263+
264+
- name: "Run tests"
265+
run: python -m unittest discover --start "./tests/" --pattern "test_offline_*.py" --verbose
266+
267+
ruff:
268+
name: "Lint tests"
269+
runs-on: ubuntu-24.04
270+
steps:
271+
- name: "Checkout"
272+
uses: actions/checkout@v4
273+
with:
274+
submodules: recursive
275+
persist-credentials: false
276+
fetch-depth: 0
277+
278+
- name: "Configure Git safe directory"
279+
run: git config --global --add safe.directory /__w/bdk-python/bdk-python
280+
281+
- name: "Install Ruff"
282+
run: curl -LsSf https://astral.sh/ruff/install.sh | sh
283+
284+
- name: "Lint test targets"
285+
run: ruff check ./tests/

0 commit comments

Comments
 (0)