#!/usr/bin/env bash set -euo pipefail repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" source_commit="$(git -C "$repo_root" rev-parse HEAD)" export CLUSTERFLUX_ACCEPTANCE_COMMIT="$source_commit" tmp_dir="$(mktemp -d)" trap 'rm -rf "$tmp_dir"' EXIT tar \ --exclude='./.git' \ --exclude='./target' \ --exclude='./private' \ --exclude='./internal' \ --exclude='./experiments' \ --exclude='./.clusterflux' \ --exclude='./vscode-extension/node_modules' \ --exclude='./scripts/containers-home' \ -C "$repo_root" \ -cf - . | tar -C "$tmp_dir" -xf - if find "$tmp_dir" -path "$tmp_dir/private" -print -quit | grep -q .; then echo "private directory leaked into public split" >&2 exit 1 fi if find "$tmp_dir" -path "$tmp_dir/experiments" -print -quit | grep -q .; then echo "experiments directory leaked into public split" >&2 exit 1 fi if find "$tmp_dir" -path "$tmp_dir/internal" -print -quit | grep -q .; then echo "internal directory leaked into public split" >&2 exit 1 fi (cd "$tmp_dir" && scripts/check-old-name.sh) (cd "$tmp_dir" && CLUSTERFLUX_FILTERED_PUBLIC_TREE=1 node scripts/check-docs.js) (cd "$tmp_dir" && scripts/check-code-size.sh) (cd "$tmp_dir" && node scripts/resource-metering-contract-smoke.js) (cd "$tmp_dir" && node scripts/hostile-input-contract-smoke.js) (cd "$tmp_dir" && node scripts/tenant-isolation-contract-smoke.js) (cd "$tmp_dir" && cargo fmt --all --check) CARGO_TARGET_DIR="$tmp_dir/target" cargo test \ --workspace \ --all-targets \ --manifest-path "$tmp_dir/Cargo.toml" CARGO_TARGET_DIR="$tmp_dir/target" cargo build \ --workspace \ --all-targets \ --manifest-path "$tmp_dir/Cargo.toml" (cd "$tmp_dir" && node scripts/cli-install-smoke.js) (cd "$tmp_dir" && node scripts/flagship-demo-smoke.js) (cd "$tmp_dir" && node scripts/cli-local-run-smoke.js) (cd "$tmp_dir" && node scripts/node-attach-smoke.js) (cd "$tmp_dir" && node scripts/vscode-extension-smoke.js) (cd "$tmp_dir" && node scripts/vscode-f5-smoke.js) (cd "$tmp_dir" && node scripts/artifact-download-smoke.js) (cd "$tmp_dir" && node scripts/artifact-export-smoke.js) public_digest="$( find "$tmp_dir" \ -path "$tmp_dir/target" -prune -o \ -type f -print0 \ | LC_ALL=C sort -z \ | xargs -0 sha256sum \ | sha256sum \ | cut -d' ' -f1 )" printf 'Filtered public tree passed: commit=%s digest=sha256:%s\n' \ "$source_commit" \ "$public_digest"