-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
89 lines (77 loc) · 4.22 KB
/
Copy pathjustfile
File metadata and controls
89 lines (77 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env just --justfile
#
# Using Just: https://github.com/casey/just?tab=readme-ov-file#installation
#
# Convenience wrapper around smoke.sh. The clients install themselves from public
# registries on each run; you bring moq-relay + moq on PATH (cargo/brew/apt).
# Run the smoke matrix (default: rust only). Pass flags through, e.g.
# just smoke --publishers rust,python,js-vite --subscribers rust,python,js-jsdelivr
# Browser variants: js-vite, js-esbuild, js-jsdelivr (vite/esbuild bundlers, jsDelivr CDN).
default *args:
./smoke.sh {{ args }}
# Alias for the default recipe.
smoke *args:
./smoke.sh {{ args }}
# Full cross-language matrix with browser cold-start headroom. Rust + browser
# publish; everyone subscribes (swift needs the macOS Xcode toolchain).
full:
./smoke.sh --publishers rust,python,js-vite,js-esbuild,js-jsdelivr --subscribers rust,python,go,swift,kotlin,c,c-pkgconfig,c-cmake,gst,js-vite,js-esbuild,js-jsdelivr,js-native-node,js-native-bun --timeout 30
# Build both Rust implementations from their latest default branches. Drive
# both relays with the Cloudflare client over WebTransport and raw QUIC.
cloudflare:
./cloudflare.sh
# Token interop: install moq-token in each published flavour and cross-verify.
# The Rust moq-token binary comes from a channel (PATH); @moq/token comes from npm,
# driven under both node and bun. Default: rust only. Pass flags through, e.g.
# just token --generators rust,js-node --verifiers rust,js-bun --algorithms HS256
token *args:
./token.sh {{ args }}
# Full token matrix: every implementation mints and verifies every other's
# tokens. rust-docker pulls the published moqdev/moq-token-cli image (needs a
# container runtime; set TOKEN_DOCKER=podman to use podman instead of docker).
token-full:
./token.sh --generators rust,js-node,js-bun,rust-docker --verifiers rust,js-node,js-bun,rust-docker
# The "nix" channel: get moq-relay + moq from the moq flake itself
# (a public distribution channel, `nix run github:moq-dev/moq#moq-cli`), instead
# of cargo/brew/apt. Referenced ad-hoc with --refresh so the moq version is the
# latest default-branch build, never locked by this repo. The devShell only
# carries client toolchains; moq is built separately here. Override the source
# with MOQ_FLAKE (e.g. a fork or a pinned ref).
MOQ_FLAKE := env_var_or_default("MOQ_FLAKE", "github:moq-dev/moq")
CACHIX_SUB := "https://kixelated.cachix.org"
CACHIX_KEY := "kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk="
nix-channel *args:
#!/usr/bin/env bash
set -euo pipefail
echo "building moq-relay + moq from {{ MOQ_FLAKE }} (latest)..."
nix_build() {
nix build --refresh --no-link --print-out-paths \
--extra-substituters "{{ CACHIX_SUB }}" \
--extra-trusted-public-keys "{{ CACHIX_KEY }}" "$1"
}
relay=$(nix_build '{{ MOQ_FLAKE }}#moq-relay')
cli=$(nix_build '{{ MOQ_FLAKE }}#moq-cli')
echo "relay: $relay"
echo "cli: $cli"
RELAY_BIN="$relay/bin/moq-relay" MOQ_BIN="$cli/bin/moq" ./smoke.sh {{ args }}
# Negative control: no publisher, every subscriber must time out.
negative *args:
./smoke.sh --negative {{ args }}
# Assert we pin nothing stale: no committed lock files, and any version we are
# forced to pin (npm playwright) matches what the toolchain provides.
freshness:
./freshness.sh
# Lint the harness. shfmt discovers every shell script (incl. the extensionless
# clients/docker/* wrappers) and reads .editorconfig for style; shellcheck lints
# the same set. Each tool is guarded so it skips when not on PATH (nix develop
# provides them all).
check:
@if command -v shfmt >/dev/null 2>&1; then shfmt --diff $(shfmt -f .); else echo "shfmt: skipped"; fi
@if command -v shellcheck >/dev/null 2>&1 && command -v shfmt >/dev/null 2>&1; then shellcheck $(shfmt -f .); else echo "shellcheck: skipped"; fi
@command -v actionlint >/dev/null && actionlint || echo "actionlint: skipped"
just freshness
# Compile-check and unit-test the local integrity client against the current
# cloudflare/moq-rs Git dependencies. The end-to-end relay check is `just cloudflare`.
cloudflare-check:
cargo update --manifest-path clients/cloudflare/Cargo.toml
cargo test --manifest-path clients/cloudflare/Cargo.toml