2026-09-10 13:10:56 -04:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
|
|
# Tests and clippy run on the Pi runner (aarch64) inside a rust container, so
|
|
|
|
|
# this CI proves the aarch64 build too. Jobs use the runner's `docker` label.
|
2026-09-12 01:39:41 -04:00
|
|
|
#
|
|
|
|
|
# Path allowlist: skip the cargo job when the change cannot affect the Rust
|
|
|
|
|
# build (docs, android, scripts, sibling workflows, markdown). No required
|
|
|
|
|
# status checks on main, so a missing run is not a merge trap.
|
|
|
|
|
# workflow_dispatch has no path filter — it always runs the suite.
|
2026-09-10 13:10:56 -04:00
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches: [main]
|
2026-09-12 01:39:41 -04:00
|
|
|
paths:
|
|
|
|
|
- "src/**"
|
|
|
|
|
- "crates/**"
|
|
|
|
|
- "tests/**"
|
|
|
|
|
- "Cargo.toml"
|
|
|
|
|
- "Cargo.lock"
|
|
|
|
|
- ".forgejo/workflows/ci.yml"
|
2026-09-10 13:10:56 -04:00
|
|
|
pull_request:
|
2026-09-12 01:39:41 -04:00
|
|
|
paths:
|
|
|
|
|
- "src/**"
|
|
|
|
|
- "crates/**"
|
|
|
|
|
- "tests/**"
|
|
|
|
|
- "Cargo.toml"
|
|
|
|
|
- "Cargo.lock"
|
|
|
|
|
- ".forgejo/workflows/ci.yml"
|
2026-09-10 13:10:56 -04:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
2026-09-10 20:12:41 -04:00
|
|
|
# One cargo job on the Pi at a time. Overlapping PR+main runs shared the
|
|
|
|
|
# container name `onionwire-ci` (docker Conflict) and OOM-killed with 137.
|
|
|
|
|
concurrency:
|
|
|
|
|
group: onionwire-ci-pi
|
|
|
|
|
cancel-in-progress: false
|
|
|
|
|
|
2026-09-10 13:10:56 -04:00
|
|
|
env:
|
|
|
|
|
CARGO_TERM_COLOR: never
|
2026-09-10 13:14:55 -04:00
|
|
|
RUST_IMAGE: rust:1.91-bookworm
|
2026-09-10 13:10:56 -04:00
|
|
|
CARGO_REGISTRY_VOLUME: onionwire-cargo-registry
|
|
|
|
|
CARGO_TARGET_VOLUME: onionwire-target-ci
|
2026-09-10 20:12:41 -04:00
|
|
|
BUILD_CONTAINER: onionwire-ci-${{ github.run_id }}
|
fix(sdk): surface Sent/Queued on send(), and build the SDK in CI
`Node::send()` became `Result<OutboxStatus, String>` in the local-outbox work,
which broke `crates/onionwire-sdk` (E0308 at src/lib.rs:195) — and nothing
noticed, because the SDK is a separate cargo workspace that root CI never
compiles and android-release.yml only builds on a v*.*.* tag.
- `Wire::send()` now returns `WResult<SendState>` (`Sent` | `Queued`) instead
of swallowing the outcome as `()`. A queued send is local-only until the
retry worker gets a circuit through, so the Kotlin boundary must be able to
tell it apart from a delivered one.
- `ChatMessage` gains `delivery: Option<String>` ("sent" | "queued" |
"sending" | "failed: <reason>"), populated from the message's outbox row;
`None` for incoming messages. An outgoing row with no outbox row was accepted
on the first attempt, so it reads "sent".
- New `sdk` job in `.forgejo/workflows/ci.yml`: `cargo test --locked` +
`cargo clippy --locked --all-targets -- -D warnings` in `crates/onionwire-sdk`
in the same rust:1.91-bookworm container, with its own target volume (the SDK
resolves the root crate with rustls, so sharing the root job's target dir
would thrash feature-unified artifacts).
- Drift found while un-rotting it: the SDK `Cargo.lock` was stale (missing
`sha2`, added to the root crate by the zeroize work), so `--locked` failed;
and the SDK README still said "no outbox, no spool in v1" and "identity keys
in sqlite are plaintext", both untrue since the outbox and SQLCipher landed.
Tests: crates/onionwire-sdk 4 passed (2 new unit tests over the status
mapping), clippy clean; root `cargo test --locked` clean. The CI job body was
smoke-run locally in the same container image before being committed.
# Conflicts:
# crates/onionwire-sdk/src/lib.rs
2026-09-12 15:16:38 -04:00
|
|
|
# The SDK job gets its own target volume: it resolves the root crate with
|
|
|
|
|
# `rustls` instead of `native-tls`, so sharing a target dir would thrash both
|
|
|
|
|
# jobs' feature-unified artifacts.
|
|
|
|
|
SDK_CARGO_TARGET_VOLUME: onionwire-target-ci-sdk
|
|
|
|
|
SDK_BUILD_CONTAINER: onionwire-ci-sdk-${{ github.run_id }}
|
2026-09-10 13:10:56 -04:00
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
test:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
timeout-minutes: 120
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout
|
|
|
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: cargo test + clippy on aarch64
|
|
|
|
|
run: |
|
|
|
|
|
set -euo pipefail
|
2026-09-10 13:50:57 -04:00
|
|
|
cd "${GITHUB_WORKSPACE}"
|
|
|
|
|
echo "workspace: $GITHUB_WORKSPACE"
|
2026-09-10 13:10:56 -04:00
|
|
|
docker volume create "$CARGO_REGISTRY_VOLUME" > /dev/null
|
|
|
|
|
docker volume create "$CARGO_TARGET_VOLUME" > /dev/null
|
|
|
|
|
docker rm -f "$BUILD_CONTAINER" > /dev/null 2>&1 || true
|
|
|
|
|
docker create --name "$BUILD_CONTAINER" -i \
|
|
|
|
|
-e CARGO_TARGET_DIR=/target \
|
|
|
|
|
-e CARGO_BUILD_JOBS=2 \
|
|
|
|
|
-e CARGO_TERM_COLOR=never \
|
|
|
|
|
-v "$CARGO_REGISTRY_VOLUME":/usr/local/cargo/registry \
|
|
|
|
|
-v "$CARGO_TARGET_VOLUME":/target \
|
|
|
|
|
-w /src \
|
|
|
|
|
"$RUST_IMAGE" \
|
|
|
|
|
sh -euxc 'mkdir -p /src && tar xzf - -C /src && cd /src \
|
|
|
|
|
&& apt-get update \
|
|
|
|
|
&& apt-get install -y --no-install-recommends pkg-config libssl-dev \
|
2026-09-10 13:24:59 -04:00
|
|
|
&& rustup component add clippy \
|
2026-09-10 13:10:56 -04:00
|
|
|
&& cargo test --locked \
|
|
|
|
|
&& cargo clippy --locked --all-targets -- -D warnings'
|
|
|
|
|
tar czf - --exclude=./target --exclude=./.git --exclude=./.worktrees . \
|
|
|
|
|
| docker start -a -i "$BUILD_CONTAINER"
|
|
|
|
|
docker rm -f "$BUILD_CONTAINER" > /dev/null
|
fix(sdk): surface Sent/Queued on send(), and build the SDK in CI
`Node::send()` became `Result<OutboxStatus, String>` in the local-outbox work,
which broke `crates/onionwire-sdk` (E0308 at src/lib.rs:195) — and nothing
noticed, because the SDK is a separate cargo workspace that root CI never
compiles and android-release.yml only builds on a v*.*.* tag.
- `Wire::send()` now returns `WResult<SendState>` (`Sent` | `Queued`) instead
of swallowing the outcome as `()`. A queued send is local-only until the
retry worker gets a circuit through, so the Kotlin boundary must be able to
tell it apart from a delivered one.
- `ChatMessage` gains `delivery: Option<String>` ("sent" | "queued" |
"sending" | "failed: <reason>"), populated from the message's outbox row;
`None` for incoming messages. An outgoing row with no outbox row was accepted
on the first attempt, so it reads "sent".
- New `sdk` job in `.forgejo/workflows/ci.yml`: `cargo test --locked` +
`cargo clippy --locked --all-targets -- -D warnings` in `crates/onionwire-sdk`
in the same rust:1.91-bookworm container, with its own target volume (the SDK
resolves the root crate with rustls, so sharing the root job's target dir
would thrash feature-unified artifacts).
- Drift found while un-rotting it: the SDK `Cargo.lock` was stale (missing
`sha2`, added to the root crate by the zeroize work), so `--locked` failed;
and the SDK README still said "no outbox, no spool in v1" and "identity keys
in sqlite are plaintext", both untrue since the outbox and SQLCipher landed.
Tests: crates/onionwire-sdk 4 passed (2 new unit tests over the status
mapping), clippy clean; root `cargo test --locked` clean. The CI job body was
smoke-run locally in the same container image before being committed.
# Conflicts:
# crates/onionwire-sdk/src/lib.rs
2026-09-12 15:16:38 -04:00
|
|
|
|
|
|
|
|
# `crates/onionwire-sdk` is a SEPARATE cargo workspace: its own Cargo.lock and
|
|
|
|
|
# a path dependency on the root crate, resolved with `rustls` instead of
|
|
|
|
|
# `native-tls`. The `test` job above therefore never compiles it, so a
|
|
|
|
|
# root-crate signature change (`Node::send` gaining the outbox result, the
|
|
|
|
|
# SQLCipher passphrase entry points) breaks the Android SDK — and the tagged
|
|
|
|
|
# release AAR, since android-release.yml only builds on `v*.*.*` — while both
|
|
|
|
|
# the root suites and local `cargo test` stay green. Build it here.
|
|
|
|
|
sdk:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
timeout-minutes: 120
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout
|
|
|
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: cargo test + clippy for crates/onionwire-sdk on aarch64
|
|
|
|
|
run: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
cd "${GITHUB_WORKSPACE}"
|
|
|
|
|
echo "workspace: $GITHUB_WORKSPACE"
|
|
|
|
|
docker volume create "$CARGO_REGISTRY_VOLUME" > /dev/null
|
|
|
|
|
docker volume create "$SDK_CARGO_TARGET_VOLUME" > /dev/null
|
|
|
|
|
docker rm -f "$SDK_BUILD_CONTAINER" > /dev/null 2>&1 || true
|
|
|
|
|
docker create --name "$SDK_BUILD_CONTAINER" -i \
|
|
|
|
|
-e CARGO_TARGET_DIR=/target \
|
|
|
|
|
-e CARGO_BUILD_JOBS=2 \
|
|
|
|
|
-e CARGO_TERM_COLOR=never \
|
|
|
|
|
-v "$CARGO_REGISTRY_VOLUME":/usr/local/cargo/registry \
|
|
|
|
|
-v "$SDK_CARGO_TARGET_VOLUME":/target \
|
|
|
|
|
-w /src \
|
|
|
|
|
"$RUST_IMAGE" \
|
|
|
|
|
sh -euxc 'mkdir -p /src && tar xzf - -C /src && cd /src/crates/onionwire-sdk \
|
|
|
|
|
&& apt-get update \
|
|
|
|
|
&& apt-get install -y --no-install-recommends pkg-config libssl-dev \
|
|
|
|
|
&& rustup component add clippy \
|
|
|
|
|
&& cargo test --locked \
|
|
|
|
|
&& cargo clippy --locked --all-targets -- -D warnings'
|
|
|
|
|
tar czf - --exclude=./target --exclude=./.git --exclude=./.worktrees \
|
|
|
|
|
--exclude=./crates/onionwire-sdk/target . \
|
|
|
|
|
| docker start -a -i "$SDK_BUILD_CONTAINER"
|
|
|
|
|
docker rm -f "$SDK_BUILD_CONTAINER" > /dev/null
|