name: Bindings
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions: read-all
jobs:
constant-parity:
name: Binding Constant Parity
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Check wrapper constants match sbom_tools.h
run: ./scripts/check-binding-constants.sh
dagger-rust-sdk:
name: Dagger CI (workspace check + staticlib + FFI tests + Go bindings)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
- name: Cache Rust
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - name: Run Dagger Rust SDK pipeline
run: ./scripts/run-dagger-ci.sh
rust-ffi:
name: Rust FFI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
- name: Cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - name: Build FFI library
run: bash ./scripts/build-bindings-mvp.sh
- name: Test FFI ABI
run: cargo test --locked --features ffi --test ffi_bindings
- name: Test ABI snapshot contracts
run: cargo test --locked --features ffi --test ffi_schema_snapshots
- name: Test FFI conformance (bidirectional ABI)
run: cargo test --locked --features ffi --test conformance_ffi
- name: Test FFI regression (PR run: cargo test --locked --features ffi --test ffi_regression
go-bindings:
name: Go Bindings (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e with:
go-version: '1.22'
- name: Cache Rust
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - name: Build Rust library
run: bash ./scripts/build-bindings-mvp.sh
- name: Test Go wrapper
working-directory: bindings/go
run: go test ./...
- name: Test Go dedup helpers
run: ./scripts/test-bindings-dedup.sh go
python-bindings:
name: Python Bindings (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with:
python-version: '3.12'
- name: Cache Rust
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - name: Build Rust library
run: cargo build -p sbom-tools-ffi --release
- name: Create Python environment
working-directory: bindings/python
run: python -m venv .venv
- name: Install Python binding
working-directory: bindings/python
run: >-
python -c "import os, pathlib, subprocess;
executable = pathlib.Path('.venv') / ('Scripts/python.exe' if os.name == 'nt' else 'bin/python');
subprocess.check_call([str(executable), '-m', 'pip', 'install', '-e', '.[test]'])"
- name: Test Python wrapper
working-directory: bindings/python
run: >-
python -c "import os, pathlib, subprocess;
executable = pathlib.Path('.venv') / ('Scripts/python.exe' if os.name == 'nt' else 'bin/python');
subprocess.check_call([str(executable), '-m', 'pytest', '-q'])"
swift-bindings:
name: Swift Bindings
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
- name: Build Rust library
run: bash ./scripts/build-bindings-mvp.sh
- name: Build and test Swift wrapper
working-directory: bindings/swift
run: swift test
- name: Test Swift dedup helpers
run: ./scripts/test-bindings-dedup.sh swift
nodejs-bindings:
name: Node.js Bindings (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 with:
node-version: '24'
cache: npm
cache-dependency-path: bindings/nodejs/package-lock.json
- name: Cache Rust
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - name: Install Node.js dependencies
working-directory: bindings/nodejs
run: npm ci
- name: Build Rust library
run: cargo build -p sbom-tools-ffi --release
- name: Build and test Node.js wrapper
working-directory: bindings/nodejs
run: npm test