diff --git a/.github/workflows/deed-conformance.yml b/.github/workflows/deed-conformance.yml index 7744b8b65..3385905dd 100644 --- a/.github/workflows/deed-conformance.yml +++ b/.github/workflows/deed-conformance.yml @@ -26,6 +26,8 @@ on: - '.github/workflows/deed-conformance.yml' - 'scripts/uuid-v8.js' - 'scripts/tests/bun/**' + - 'tools/uuid-v8/**' + - 'scripts/tests/rust/**' pull_request: paths: - '**.deed' @@ -33,6 +35,8 @@ on: - '.github/workflows/deed-conformance.yml' - 'scripts/uuid-v8.js' - 'scripts/tests/bun/**' + - 'tools/uuid-v8/**' + - 'scripts/tests/rust/**' workflow_call: inputs: require-files: @@ -80,6 +84,11 @@ jobs: - name: uuid-v8 generator against an independent sha256sum oracle (#u8 = profile C) if: github.repository == 'hyperpolymath/standards' run: bash scripts/tests/bun/uuid-v8-gen-test.sh + - name: uuid-v8 Rust generator (tools/uuid-v8) against the same oracle, the bun generator and check-uuid-v8.sh + if: github.repository == 'hyperpolymath/standards' + run: | + cargo test --quiet --locked --manifest-path tools/uuid-v8/Cargo.toml + bash scripts/tests/rust/uuid-v8-rs-test.sh - name: lint every committed deed env: REQUIRE_FILES: ${{ inputs.require-files || false }} diff --git a/scripts/tests/rust/uuid-v8-rs-test.sh b/scripts/tests/rust/uuid-v8-rs-test.sh new file mode 100755 index 000000000..bdb1d67ed --- /dev/null +++ b/scripts/tests/rust/uuid-v8-rs-test.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# +# Proves tools/uuid-v8 (the shared Rust ESTATE-UUID-V8 generator, ADR-008) +# emits the same ids as the independent oracle in +# scripts/tests/bun/uuid-v8-gen-test.sh (sha256sum and shell nibble +# arithmetic), the same ids as scripts/uuid-v8.js when bun is present, and ids +# that check-uuid-v8.sh --strict accepts. +# +# Lives below scripts/tests/ so run-shell-test-suite.sh (maxdepth 1) does not +# discover it; deed-conformance.yml runs it next to the bun generator test. +set -euo pipefail +ROOT="$(cd "$(dirname "$0")/../../.." && pwd)" +MANIFEST="$ROOT/tools/uuid-v8/Cargo.toml" +CHECK="$ROOT/scripts/check-uuid-v8.sh" +WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT +pass=0; fail=0 + +cargo build --quiet --release --locked --manifest-path "$MANIFEST" +GEN="$ROOT/tools/uuid-v8/target/release/uuid-v8" + +# Record one assertion: check