forked from payjoin/rust-payjoin
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.41 KB
/
python.yml
File metadata and controls
54 lines (46 loc) · 1.41 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
name: Build and Test Python
on:
pull_request:
paths:
- payjoin-ffi/**
env:
# Override the value from the rust-toolchain file
# This is necessary because even though the correct toolchain
# is explicitly specified for the rust-toolchain action,
# rustup honors the rust-toolchain file over the default
RUSTUP_TOOLCHAIN: 1.85
jobs:
build-python-and-test:
name: "Build and test python"
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: payjoin-ffi/python
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Install Rust 1.85.0"
uses: dtolnay/rust-toolchain@1.85.0
- name: "Install Python"
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: "Use cache"
uses: Swatinem/rust-cache@v2
- name: "Generate payjoin-ffi.py and binaries"
run: bash ./scripts/generate_bindings.sh
- name: "Build wheel"
run: python -m build --wheel
- name: "Install wheel"
run: pip install ./dist/*.whl
- name: "Run tests"
# Skip integration test on macOS due to Docker issues
run: |
if [[ "${{ matrix.os }}" = "macos-latest" ]]; then
python -m unittest test/test_payjoin_unit_test.py -v
else
python -m unittest -v
fi