Skip to content

docs(spec): bstack substrate completion roadmap (v0.4.0 → v1.0.0) #9

docs(spec): bstack substrate completion roadmap (v0.4.0 → v1.0.0)

docs(spec): bstack substrate completion roadmap (v0.4.0 → v1.0.0) #9

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
lint:
name: Lint shell + JSON templates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: ShellCheck (scripts + bin)
run: |
# Only lint files that have a shebang we recognize.
set -euo pipefail
mapfile -t targets < <(
find scripts bin -type f \( -name "*.sh" -o ! -name "*.*" \) 2>/dev/null \
| xargs -I {} sh -c 'head -n1 "{}" | grep -q "^#!.*sh" && echo "{}"' \
| sort -u
)
if [ "${#targets[@]}" -eq 0 ]; then
echo "No shell scripts found to lint."
exit 0
fi
printf ' • %s\n' "${targets[@]}"
# Excluded checks (bstack's defensive shell style accepts these):
# SC1091 — don't follow sourced files.
# SC2155 — declare-and-assign masks return code (intentional).
# SC2034 — unused variable. Several scripts intentionally name
# variables that are only used in conditional branches
# shellcheck can't see. Suppressed at the lint gate;
# per-file SC2034 audit is a follow-up.
shellcheck --severity=warning \
--exclude=SC1091,SC2155,SC2034 \
"${targets[@]}"
- name: Validate JSON templates
run: |
set -euo pipefail
shopt -s nullglob
fail=0
for f in assets/templates/*.snippet; do
if ! jq -e . "$f" >/dev/null 2>&1; then
echo "::error file=$f::invalid JSON shape"
fail=1
else
echo " • $f — valid JSON"
fi
done
exit "$fail"
doctor:
name: bstack doctor (primitive-contract lint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run doctor against templates
run: |
set -euo pipefail
mkdir -p .control
cp assets/templates/CLAUDE.md.template ./CLAUDE.md 2>/dev/null || true
cp assets/templates/AGENTS.md.template ./AGENTS.md 2>/dev/null || true
cp assets/templates/policy.yaml.template .control/policy.yaml 2>/dev/null || true
bash scripts/doctor.sh --quiet
tests:
name: tests/*.test.sh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run vetted test suite
# The tests/ suite is being incrementally migrated to a green-on-CI
# state. Two pre-existing test files were broken before 0.2.3
# introduced the CI lane:
# tests/template_lockstep.test.sh — asserts "twenty irreducible
# primitives" verbatim in SKILL.md; the description was
# compressed in 0.2.1 (PR #26) and the assertion was not
# updated. Cosmetic, follow-up.
# tests/onboard.test.sh — T3+ steps hang in the GitHub Actions
# runner because the script expects interactive input the
# env doesn't provide. Needs --non-interactive flag in
# scripts/onboard.sh.
# Both are pre-existing failures, out of scope for the 0.2.x →
# 0.3.0 release-infra series. CI gate runs only the vetted-green
# suite until they are fixed.
run: |
set -euo pipefail
# Vetted: known to pass on CI. Add new test files here as they
# ship green.
VETTED=(
tests/repair-merge-hooks.test.sh
)
fail=0
for t in "${VETTED[@]}"; do
[ -f "$t" ] || continue
echo ""
echo "=== $t ==="
if ! bash "$t"; then
echo "::error file=$t::test failed"
fail=1
fi
done
exit "$fail"