Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into coda/asyncless-transa…
Browse files Browse the repository at this point in the history
…ctions
  • Loading branch information
codabrink committed Jan 29, 2025
2 parents 0403629 + a48e9a7 commit c94ad52
Show file tree
Hide file tree
Showing 21 changed files with 358 additions and 103 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/lint-ffi-bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- "rustfmt.toml"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings --cfg tracing_unstable
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
lint:
name: Lint
Expand All @@ -19,13 +22,20 @@ jobs:
uses: actions/checkout@v4
- name: Update rust toolchains
run: rustup update
- uses: taiki-e/install-action@v2
with:
tool: clippy-sarif,sarif-fmt
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bindings_ffi
- name: Run clippy and fail on warnings
run: cargo clippy --manifest-path bindings_ffi/Cargo.toml --all-features --all-targets --no-deps -- -Dwarnings
run: cargo clippy --locked --manifest-path bindings_ffi/Cargo.toml --all-features --all-targets --no-deps --message-format=json | clippy-sarif | tee results.sarif | sarif-fmt
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
- name: Run format check
run: cargo fmt --manifest-path bindings_ffi/Cargo.toml --check
21 changes: 11 additions & 10 deletions .github/workflows/lint-node-bindings.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Lint Node Bindings

on:
pull_request:
paths:
Expand All @@ -8,30 +7,35 @@ on:
- "rustfmt.toml"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings --cfg tracing_unstable
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
lint:
name: Lint
runs-on: warp-ubuntu-latest-x64-16x
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update rust toolchains
run: rustup update

- uses: taiki-e/install-action@v2
with:
tool: clippy-sarif,sarif-fmt
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bindings_node
- name: Run clippy and fail on warnings
run: cargo clippy --manifest-path bindings_node/Cargo.toml --all-features --all-targets --no-deps -- -Dwarnings

run: cargo clippy --locked --manifest-path bindings_node/Cargo.toml --all-features --all-targets --no-deps --message-format=json | clippy-sarif | tee results.sarif | sarif-fmt
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
- name: Run format check
run: cargo fmt --manifest-path bindings_node/Cargo.toml --check

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

- name: Enable corepack
run: corepack enable

- name: Install dependencies
working-directory: bindings_node
run: |
yarn
- name: Format check
working-directory: bindings_node
run: |
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/lint-wasm-bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- "rustfmt.toml"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings --cfg tracing_unstable
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
lint:
name: Lint
Expand All @@ -16,12 +19,19 @@ jobs:
uses: actions/checkout@v4
- name: Update rust toolchains
run: rustup update
- uses: taiki-e/install-action@v2
with:
tool: clippy-sarif,sarif-fmt
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
bindings_wasm
- name: Run clippy and fail on warnings
run: cargo clippy --manifest-path bindings_wasm/Cargo.toml --all-features --target wasm32-unknown-unknown --no-deps -- -Dwarnings
run: cargo clippy --locked --manifest-path bindings_wasm/Cargo.toml --all-features --target wasm32-unknown-unknown --no-deps --message-format=json | clippy-sarif | tee results.sarif | sarif-fmt
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
- name: Run format check
run: cargo fmt --manifest-path bindings_wasm/Cargo.toml --check
12 changes: 11 additions & 1 deletion .github/workflows/lint-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
- "rustfmt.toml"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings --cfg tracing_unstable
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
lint:
name: Lint
Expand All @@ -30,13 +33,20 @@ jobs:
uses: actions/checkout@v4
- name: Update rust toolchains
run: rustup update
- uses: taiki-e/install-action@v2
with:
tool: clippy-sarif,sarif-fmt
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: Run clippy and fail on warnings
# Exclude bindings_wasm since it only compiles for wasm32
run: cargo clippy --workspace --all-features --all-targets --no-deps --exclude bindings_wasm -- -Dwarnings
run: cargo clippy --locked --workspace --all-features --all-targets --no-deps --exclude bindings_wasm --message-format=json | clippy-sarif | tee results.sarif | sarif-fmt
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
- name: Run format check
run: cargo fmt --check
22 changes: 4 additions & 18 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Release CLI

on:
push:
branches:
Expand All @@ -24,64 +23,54 @@ jobs:
- build: macos-aarch64
runner: warp-macos-13-arm64-6x
target: aarch64-apple-darwin
# - build: windows-x86_64-gnu
# runner: windows-latest
# target: x86_64-pc-windows-gnu
# - build: windows-x86_64-gnu
# runner: windows-latest
# target: x86_64-pc-windows-gnu
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update rust toolchains
run: |
rustup update
rustup target add ${{ matrix.target }}
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: Configure x86_64-unknown-linux-musl toolchain
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Install openssl windows
if: ${{ matrix.build == 'windows-x86_64-gnu' }}
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install openssl

- name: Build target
run: |
cargo build --release --target ${{ matrix.target }} --manifest-path examples/cli/Cargo.toml --target-dir examples/cli/target
cargo build --locked --release --target ${{ matrix.target }} --manifest-path examples/cli/Cargo.toml --target-dir examples/cli/target
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build }}
path: examples/cli/target/${{ matrix.target }}/release/xmtp_cli*
retention-days: 1

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts

- name: Get short SHA
id: slug
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -93,7 +82,6 @@ jobs:
body: "Release of cli for commit ${{ github.sha}}"
draft: false
prerelease: true

# - name: Upload Release Asset
# uses: actions/upload-release-asset@v1
# env:
Expand All @@ -103,7 +91,6 @@ jobs:
# asset_path: ./examples/cli/target/x86_64-pc-windows-gnu.exe
# asset_name: cli-x86_64-pc-windows-gnu.exe
# asset_content_type: application/octet-stream

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
Expand All @@ -113,7 +100,6 @@ jobs:
asset_path: ./artifacts/macos-aarch64/xmtp_cli
asset_name: cli-macos-aarch64
asset_content_type: application/octet-stream

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-ffi-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
- "rust-toolchain"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings --cfg tracing_unstable
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
test:
name: Test
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-http-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
- "rust-toolchain"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings --cfg tracing_unstable
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
test:
name: Test
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test-webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ on:
- "rust-toolchain"
env:
CARGO_TERM_COLOR: always
WASM_BINDGEN_TEST_TIMEOUT: 180
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings --cfg tracing_unstable
CARGO_PROFILE_TEST_DEBUG: 0
WASM_BINDGEN_TEST_TIMEOUT: 240
WASM_BINDGEN_TEST_ONLY_WEB: 1
WASM_BINDGEN_SPLIT_LINKED_MODULES: 1
jobs:
Expand All @@ -35,10 +38,10 @@ jobs:
- name: Start Docker containers
run: dev/up
- name: Build WebAssembly Packages
run: cargo build --tests --release --target wasm32-unknown-unknown -p xmtp_id -p xmtp_mls -p xmtp_api_http -p xmtp_cryptography -p xmtp_common
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
- name: test with chrome
run: |
cargo test --release --target wasm32-unknown-unknown -p xmtp_mls -p xmtp_id -p xmtp_api_http -p xmtp_cryptography -- \
cargo test --locked --release --target wasm32-unknown-unknown -p xmtp_mls -p xmtp_id -p xmtp_api_http -p xmtp_cryptography -- \
--skip xmtp_mls::storage::encrypted_store::group_message::tests::it_cannot_insert_message_without_group \
--skip xmtp_mls::groups::tests::process_messages_abort_on_retryable_error \
--skip xmtp_mls::storage::encrypted_store::group::tests::test_find_groups \
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
- "rust-toolchain"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings --cfg tracing_unstable
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
test:
name: Test
Expand Down
3 changes: 3 additions & 0 deletions Cargo.lock

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

Loading

0 comments on commit c94ad52

Please sign in to comment.