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
48 changes: 48 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,54 @@ jobs:
- name: Test bytecode output
run: cargo insta test -p insta-bytecode

ffi-tests:
name: Test FFI
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs:
- fmt
- typos
- clippy
- docs
- msrv
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
- os: ubuntu-26.04-arm
- os: ubuntu-latest
steps:
- name: Set environment
# Setting `RUSTFLAGS` overrides any flags set on .cargo/config.toml, so we need to
# set the target flags instead which are cumulative.
# Track https://github.com/rust-lang/cargo/issues/5376
run: |
target=$(rustc -vV | awk '/^host/ { print $2 }' | tr '[:lower:]' '[:upper:]' | tr '-' '_')
echo "CARGO_TARGET_${target}_RUSTFLAGS=$W_FLAGS" >> $GITHUB_ENV

- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
with:
toolchain: stable

- name: Cache Cargo
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3

- name: Check generated C headers
run: |
cargo run --locked --profile ci -p diplomat-gen
git status --short --untracked-files=all -- ffi/boa_ffi/bindings/c/
test -z "$(git status --porcelain --untracked-files=all -- ffi/boa_ffi/bindings/c/)"

- name: Test C bindings
run: ./ffi/boa_ffi/tests/c/run.sh --ci

cross-tests:
name: Test
runs-on: ubuntu-latest
Expand Down
168 changes: 168 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ bitflags = "2.13.2"
clap = "4.6.7"
colored = "3.1.1"
cow-utils = "0.1.3"
diplomat = { version = "0.16.0", default-features = false }
diplomat-runtime = { version = ">= 0.15.2, < 0.17.0", default-features = false }
diplomat-tool = { version = "0.16.0", default-features = false }
fast-float2 = "0.2.4"
hashbrown = "0.17.1"
http = { version = "1.5.0" }
Expand Down
1 change: 1 addition & 0 deletions ffi/boa_ffi/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bindings/** linguist-generated=true
21 changes: 21 additions & 0 deletions ffi/boa_ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "boa_ffi"
description = "C bindings for the Boa JavaScript engine"
publish = false
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
boa_engine.workspace = true
diplomat.workspace = true
diplomat-runtime.workspace = true

[lints]
workspace = true
Loading
Loading