Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android/iOS CI Checks #1667

Merged
merged 12 commits into from
Feb 27, 2025
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
72 changes: 72 additions & 0 deletions .github/workflows/check-ios-android-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Check iOS & Android Bindings
on:
push:
branches:
- main
pull_request:
paths:
- ".github/workflows/check-ios-android-bindings.yml"
- "bindings_ffi/**"
- "Cargo.toml"
- "Cargo.lock"
- "dev/**"
- "rust-toolchain"
- ".cargo/**"
jobs:
check-swift:
runs-on: warp-macos-13-arm64-6x
strategy:
fail-fast: false
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
# Mostly to avoid GitHub rate limiting
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/flakehub-cache-action@main
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: Build target
run: |
nix develop . --command \
cargo check --target ${{ matrix.target }} --manifest-path bindings_ffi/Cargo.toml
check-android:
runs-on: warp-ubuntu-latest-x64-16x
strategy:
fail-fast: false
matrix:
target:
- x86_64-linux-android
# We can add other targets later by making a pkg derivation and configuring LD_LIBRARY_PATH
# according to https://github.com/bburdette/tauri-zknotes/blob/7aa3495dc2c8a266d81c2fa3e51ae347e9c2597d/flake.nix#L158
# but this is good for just checking to ensure it compiles on this target
# Can also run android emulator here after cloning xmtp-android
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
# Mostly to avoid GitHub rate limiting
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/flakehub-cache-action@main
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: check target
run: |
nix develop .#android --command \
cargo check --target ${{ matrix.target }} --manifest-path bindings_ffi/Cargo.toml
148 changes: 74 additions & 74 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions bindings_ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tracing-subscriber = { workspace = true, features = [
"fmt",
"json",
] }
uniffi = { version = "0.28.0", default-features = false, features = ["tokio"] }
uniffi = { version = "0.29.0", default-features = false, features = ["tokio"] }
xmtp_api.workspace = true
xmtp_api_grpc.workspace = true
xmtp_common.workspace = true
Expand All @@ -45,7 +45,7 @@ tracing_android_trace = { version = "0.1", features = ["api_level_29"] }
tracing-oslog = "0.2"

[build-dependencies]
uniffi = { version = "0.28.0", features = ["build"] }
uniffi = { version = "0.29.0", features = ["build"] }

[[bin]]
name = "ffi-uniffi-bindgen"
Expand All @@ -56,7 +56,7 @@ required-features = ["uniffi/cli"]
ethers = { workspace = true, features = ["rustls"] }
rand.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread"] }
uniffi = { version = "0.28.0", features = ["bindgen-tests"] }
uniffi = { version = "0.29.0", features = ["bindgen-tests"] }
uuid = { workspace = true, features = ["v4", "fast-rng"] }
xmtp_api_grpc = { workspace = true, features = ["test-utils"] }
xmtp_mls = { workspace = true, features = ["test-utils"] }
Expand Down
10 changes: 8 additions & 2 deletions bindings_ffi/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ mod ios {
let libxmtp_filter = EnvFilter::builder()
.parse(FILTER_DIRECTIVE)
.unwrap_or_else(|_| EnvFilter::new("info"));

let subsystem = format!("org.xmtp.{}", env!("CARGO_PKG_NAME"));

OsLogger::new(subsystem, "default").with_filter(libxmtp_filter)
}
}
Expand Down Expand Up @@ -104,11 +102,19 @@ pub use test_logger::*;
#[cfg(test)]
mod test_logger {
use super::*;
use tracing_subscriber::EnvFilter;

pub fn native_layer<S>() -> impl Layer<S>
where
S: Subscriber + for<'a> LookupSpan<'a>,
{
xmtp_common::logger_layer()
}

#[test]
fn test_directive() {
let _filer = EnvFilter::builder()
.parse(FILTER_DIRECTIVE)
.expect("should parse correctly");
}
}
2 changes: 1 addition & 1 deletion bindings_node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"prettier-plugin-packagejson": "^2.5.8",
"tsx": "^4.19.3",
"typescript": "^5.7.3",
"uuid": "^11.0.5",
"uuid": "^11.1.0",
"viem": "^2.23.2",
"vite": "^6.1.0",
"vite-tsconfig-paths": "^5.1.4",
Expand Down
Loading
Loading