Skip to content

Commit 2fc87c7

Browse files
committed
fix(ci): update python workflow to use build script
1 parent a612dea commit 2fc87c7

1 file changed

Lines changed: 47 additions & 12 deletions

File tree

.github/workflows/ffi-python.yml

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,55 @@ jobs:
1616
with:
1717
path: cdk
1818

19-
- name: Install Nix
20-
uses: DeterminateSystems/nix-installer-action@v17
19+
- name: Checkout CDK Python
20+
uses: actions/checkout@v4
21+
with:
22+
repository: cashubtc/cdk-python
23+
path: cdk-python
24+
25+
- name: Install Rust
26+
uses: dtolnay/rust-toolchain@stable
27+
with:
28+
targets: x86_64-unknown-linux-gnu
2129

22-
- name: Nix Cache
23-
uses: DeterminateSystems/magic-nix-cache-action@main
30+
- name: Install Just
31+
uses: extractions/setup-just@v1
2432

25-
- name: Rust Cache
26-
uses: Swatinem/rust-cache@v2
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
2735
with:
28-
workspaces: cdk
36+
python-version: "3.10"
37+
38+
- name: Install build dependencies
39+
run: |
40+
pip install build wheel uv
41+
sudo apt-get update
42+
sudo apt-get install -y libssl-dev pkg-config
43+
44+
- name: Build Wheel
45+
run: |
46+
cd cdk-python
47+
chmod +x scripts/generate-linux-x86_64.sh
48+
# The script expects CDK at ./cdk or ../cdk.
49+
# Since we checked out 'cdk' at root and 'cdk-python' at root, ../cdk works from inside cdk-python.
50+
./scripts/generate-linux-x86_64.sh
51+
52+
# Build the wheel
53+
python -m build --wheel
2954
30-
- name: Generate and Test
55+
- name: Verify
3156
run: |
32-
cd cdk
33-
# Builds cdk-ffi, generates python bindings, and runs internal integration tests
34-
# using the 'ffi' devShell from cdk's flake which has python3 installed
35-
nix develop .#ffi --command just ffi-test
57+
cd cdk-python
58+
uv venv
59+
source .venv/bin/activate
60+
61+
# Install the built wheel
62+
# find dist/ -name "*.whl" | xargs uv pip install
63+
# Or install in editable mode if preferred, but wheel is better test of release artifact
64+
uv pip install dist/*.whl
65+
66+
# Install test deps
67+
uv pip install pytest pytest-asyncio
68+
69+
# Run tests
70+
pytest

0 commit comments

Comments
 (0)