Skip to content

Commit

Permalink
Use opfs-sahpool from diesel, remove sqlite-web (#1690)
Browse files Browse the repository at this point in the history
Use sqlite-wasm-rs
  • Loading branch information
insipx authored Mar 4, 2025
1 parent 6219b8a commit b35be52
Show file tree
Hide file tree
Showing 62 changed files with 448 additions and 564 deletions.
1 change: 0 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ r = "run"
t = "test"
xdbg = "run --release --bin xdbg --"
xli = "run --bin xmtp_cli --"
xtask = "run --package xtask --"

[build]
rustflags = ["--cfg", "tracing_unstable"]
12 changes: 9 additions & 3 deletions .github/workflows/check-ios-android-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jobs:
# Mostly to avoid GitHub rate limiting
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/flakehub-cache-action@main
- uses: cachix/cachix-action@v14
with:
name: xmtp
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Cache
uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -60,8 +63,11 @@ jobs:
# 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: cachix/cachix-action@v14
with:
name: xmtp
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: cache rust artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: |
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/lint-wasm-bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ jobs:
with:
workspaces: |
bindings_wasm
- name: Install emscripten toolchains
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
- name: Run clippy and fail on warnings
run: cargo clippy --locked --manifest-path bindings_wasm/Cargo.toml --all-features --target wasm32-unknown-unknown --no-deps -- -D warnings
run: |
source ./emsdk/emsdk_env.sh
cargo clippy --locked --manifest-path bindings_wasm/Cargo.toml --all-features --target wasm32-unknown-unknown --no-deps -- -D warnings
- name: Run format check
run: cargo fmt --manifest-path bindings_wasm/Cargo.toml --check
17 changes: 6 additions & 11 deletions .github/workflows/release-wasm-bindings.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Release WASM Bindings

on:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
release:
permissions:
Expand All @@ -14,23 +11,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update rust toolchains, add target
run: |
rustup update
- name: Install emscripten toolchains
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bindings_wasm
- name: Install wasm-bindgen
uses: taiki-e/install-action@v2
with:
tool: wasm-bindgen

- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -39,19 +38,15 @@ jobs:
cache: "yarn"
env:
SKIP_YARN_COREPACK_CHECK: "1"

- name: Enable corepack
run: corepack enable

- name: Install dependencies
working-directory: bindings_wasm
run: |
yarn
- name: Build
working-directory: bindings_wasm
run: yarn build

- name: Publish to NPM
uses: JS-DevTools/npm-publish@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ffi-bindings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test FFI Bindings
name: Test iOS/Android Bindings
on:
push:
branches:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test-webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ jobs:
.
- name: Start Docker containers
run: dev/up
- name: Install emscripten toolchains
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
- name: Build WebAssembly Packages
run: cargo build --locked --tests --release --target wasm32-unknown-unknown -p xmtp_id -p xmtp_mls -p xmtp_api_http -p xmtp_cryptography -p xmtp_common
run: |
source ./emsdk/emsdk_env.sh
cargo build --locked --tests --release --target wasm32-unknown-unknown -p xmtp_id -p xmtp_mls -p xmtp_api_http -p xmtp_cryptography -p xmtp_common
- name: test with chrome
run: |
cargo test --locked --release --target wasm32-unknown-unknown -p xmtp_mls -p xmtp_id -p xmtp_api_http -p xmtp_cryptography -p xmtp_api -- \
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ coverage

# Bower dependency directory (https://bower.io/)
bower_components
result/**

# node-waf configuration
.lock-wscript
Expand Down
Loading

0 comments on commit b35be52

Please sign in to comment.