#!/bin/sh set -eu . "$(dirname "$0")/common.sh" xburner_init WORKFLOW_WASM="${ROOT_DIR}/samples/workflow-health.wasm" PROFILE="" RUN_CONFIG_LOADER=1 RUN_MANUAL_HTTPS=1 RUN_SIMPLE_SAMPLE=1 RUN_WORKFLOW_SAMPLE=1 RUN_GRPC_HARDENING=1 RUN_GRPC_SAMPLE=1 usage() { printf 'usage: %s [--profile darwin|linux|generic] [--skip-config-loader] [--skip-manual-https] [--skip-simple-sample] [--skip-workflow-sample] [--skip-grpc-hardening] [--skip-grpc-sample]\n' "$0" >&2 exit 2 } while [ $# -gt 0 ]; do case "$1" in --profile) shift [ $# -gt 0 ] || usage PROFILE=$1 ;; --skip-config-loader) RUN_CONFIG_LOADER=0 ;; --skip-manual-https) RUN_MANUAL_HTTPS=0 ;; --skip-simple-sample) RUN_SIMPLE_SAMPLE=0 ;; --skip-workflow-sample) RUN_WORKFLOW_SAMPLE=0 ;; --skip-grpc-hardening) RUN_GRPC_HARDENING=0 ;; --skip-grpc-sample) RUN_GRPC_SAMPLE=0 ;; --help|-h) usage ;; *) usage ;; esac shift done preflight() { if [ "${SKIP_ZIG_BUILD:-0}" = "1" ] && [ ! -x "${XBURNER_BIN}" ]; then printf >&2 'missing %s; run `zig build -Doptimize=ReleaseFast` or unset SKIP_ZIG_BUILD\n' "${XBURNER_BIN}" exit 1 fi if [ "${SKIP_WORKFLOW_WASM_BUILD:-0}" = "1" ] && [ ! -f "${WORKFLOW_WASM}" ]; then printf >&2 'missing %s; run `sh scripts/build_workflow_sample_wasm.sh` or unset SKIP_WORKFLOW_WASM_BUILD\n' "${WORKFLOW_WASM}" exit 1 fi } preflight if [ -n "${PROFILE}" ]; then OS_NAME=${PROFILE} else OS_NAME=$(uname -s) fi run_step() { label=$1 shift printf 'release smoke: %s\n' "${label}" "$@" } xburner_build_if_needed -Doptimize=ReleaseFast xburner_build_workflow_sample_if_needed run_step scaffold env SKIP_ZIG_BUILD=1 SKIP_WORKFLOW_WASM_BUILD=1 sh "${ROOT_DIR}/scripts/test_workflow_scaffold.sh" if [ "${RUN_CONFIG_LOADER}" -eq 1 ]; then run_step config-loader-suite env SKIP_ZIG_BUILD=1 SKIP_WORKFLOW_WASM_BUILD=1 sh "${ROOT_DIR}/scripts/test_config_loader_suite.sh" fi if [ "${RUN_GRPC_HARDENING}" -eq 1 ]; then run_step grpc-hardening env SKIP_ZIG_BUILD=1 sh "${ROOT_DIR}/scripts/test_grpc_hardening.sh" fi if [ "${RUN_GRPC_SAMPLE}" -eq 1 ]; then run_step grpc-sample env SKIP_ZIG_BUILD=1 sh "${ROOT_DIR}/scripts/test_samples.sh" grpc fi case "${OS_NAME}" in Darwin|darwin) if [ "${RUN_MANUAL_HTTPS}" -eq 1 ]; then run_step manual-https env SKIP_ZIG_BUILD=1 sh "${ROOT_DIR}/scripts/test_manual_tls_keepalive.sh" fi if [ "${RUN_WORKFLOW_SAMPLE}" -eq 1 ]; then run_step workflow-sample env SKIP_ZIG_BUILD=1 SKIP_WORKFLOW_WASM_BUILD=1 sh "${ROOT_DIR}/scripts/test_samples.sh" workflow fi printf 'release smoke profile: darwin\n' ;; Linux|linux) if [ "${RUN_SIMPLE_SAMPLE}" -eq 1 ]; then run_step simple-sample env SKIP_ZIG_BUILD=1 sh "${ROOT_DIR}/scripts/test_samples.sh" simple fi printf 'release smoke profile: linux\n' ;; generic) printf 'release smoke profile: generic\n' ;; *) printf 'release smoke profile: generic (%s)\n' "${OS_NAME}" ;; esac printf 'release smoke checks passed\n'