Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Bindings

on:
push:
branches: [develop, sdk-bindings]
paths:
- ".github/workflow/bindings.yml"
- "bindings/**"
- "crates/iota-sdk-ffi/**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

concurrency:
group: sdk-bindings-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
kotlin:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build the dynamic library
run: cargo build -p iota-sdk-ffi --lib --release
- name: Generate the bindings
run: cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi.so" --language kotlin --out-dir bindings/kotlin/lib --no-format -c bindings/kotlin/uniffi.toml
- name: Copy the dynamic library to the bindings directory
run: cp target/release/libiota_sdk_ffi.so bindings/kotlin/lib/
- name: Checks for uncommitted changes
run: git diff --exit-code
- name: Install Gradle
run: |
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install gradle
- name: Run the example
run: |
cd bindings/kotlin
./gradlew build clean
LD_LIBRARY_PATH=./lib ./gradlew run -q
go:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uniffi-bindgen-go
run: cargo install uniffi-bindgen-go --git https://github.com/filament-dm/uniffi-bindgen-go --rev ab7315502bd6b979207fdae854e87d531ee8764d
- name: Build the dynamic library
run: cargo build -p iota-sdk-ffi --lib --release
- name: Generate the bindings
run: uniffi-bindgen-go --library target/release/libiota_sdk_ffi.so --out-dir ./bindings/go --no-format
- name: Checks for uncommitted changes
run: git diff --exit-code
- name: Run the example
run: cd bindings/go && LD_LIBRARY_PATH="../../target/release" CGO_LDFLAGS="-liota_sdk_ffi -L../../target/release" go run test.go
python:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build the dynamic library
run: cargo build -p iota-sdk-ffi --lib --release
- name: Generate the bindings
run: cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi.so" --language python --out-dir bindings/python/lib --no-format
- name: Copy the dynamic library to the bindings directory
run: cp target/release/libiota_sdk_ffi.so bindings/python/lib/
- name: Checks for uncommitted changes
run: git diff --exit-code
- name: Run the example
run: cd bindings/python && python3 test.py
Loading