def764640b
The hosted CI job failed at the very first cargo command (reported as a "clippy" failure only because the job is named "fmt / clippy / test"). The real cause: every cargo command runs `cargo metadata` over the whole workspace first, and gp-nostr/gp-server/gp-goblin-sender have path deps into out-of-repo siblings (nip44, nym, the private goblin tree) that a hosted GitHub runner can't check out. `-p gp-core` scoping runs after metadata, so it never helped — the job could not pass as written. Add a CI-only step that drops those three members from Cargo.toml before any cargo command runs, leaving the self-contained core gate (gp-core, gp-wallet). The committed manifest is unchanged, so the deploy host (where the siblings exist) still builds the full workspace and runs the full ./ci.sh gate.
74 lines
3.0 KiB
YAML
74 lines
3.0 KiB
YAML
# CI gate for GoblinPay. Mirror of .gitea/workflows/ci.yml, plus the workspace
|
|
# trim below (this hosted runner can't reach the private siblings; a deploy-host
|
|
# runner with the siblings present does not need it).
|
|
#
|
|
# What runs where:
|
|
# - fmt + the gp-core clippy/test gate run on ANY runner — BUT every cargo
|
|
# command runs `cargo metadata` over the whole workspace first, and
|
|
# gp-nostr/gp-server/gp-goblin-sender have path deps into out-of-repo
|
|
# siblings (nip44/ and the private goblin/ tree) that a hosted runner
|
|
# can't check out. `-p` scoping does NOT skip that resolution, so the trim
|
|
# step drops those members before any cargo command. What's left (gp-core,
|
|
# gp-wallet) is self-contained and holds the domain logic (config, invoices,
|
|
# matching, webhooks, rates, the connector seam).
|
|
# - The FULL gate (gp-nostr + gp-server + the gp-goblin-sender round-trip, via
|
|
# ./ci.sh) needs the sibling checkouts next to the repo: nip44/ (the Nostr
|
|
# path) and goblin/ (the round-trip gate). It runs where the workspace is
|
|
# laid out like the deploy host; otherwise it is skipped below.
|
|
name: ci
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
jobs:
|
|
rust:
|
|
name: fmt / clippy / test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Scope workspace to hosted-runnable crates
|
|
# gp-nostr/gp-server/gp-goblin-sender have path deps into out-of-repo
|
|
# siblings (nip44, the private goblin tree) this hosted runner
|
|
# can't check out, so `cargo metadata` can't resolve them here — and it
|
|
# runs before any `-p` scoping. Drop them from the members list so the
|
|
# self-contained core gate (gp-core, gp-wallet) can run. The full
|
|
# workspace is unchanged in the repo and still builds on the deploy
|
|
# host, where the siblings exist.
|
|
run: sed -i '/crates\/gp-goblin-sender\|crates\/gp-nostr\|crates\/gp-server/d' Cargo.toml
|
|
|
|
- name: Format check (self-contained crates)
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Clippy (gp-core, deny warnings)
|
|
run: cargo clippy -p gp-core --all-targets -- -D warnings
|
|
|
|
- name: Test (gp-core)
|
|
run: cargo test -p gp-core --locked
|
|
|
|
- name: Full gate (when sibling checkouts are present)
|
|
run: |
|
|
if [ -d ../nip44 ] && [ -d ../goblin ]; then
|
|
echo "Workspace siblings present — running the full ./ci.sh gate."
|
|
./ci.sh
|
|
else
|
|
echo "nip44/goblin siblings absent on this runner;"
|
|
echo "the full gp-server gate runs via ./ci.sh on the deploy host."
|
|
fi
|