#!/usr/bin/env bash # Local CI: run host unit tests, then build the firmware. # Usage: scripts/ci.sh [tests|builds] one half only; both by default set -euo pipefail source "$(dirname "$0")/_docker.sh" DOCKER_EXTRA=() case "${1:-all}" in tests) STEPS='pio test -e native' ;; builds) STEPS='pio run -e cardputer-adv -e cardputer-adv-debug' ;; all) STEPS='pio test -e native && pio run -e cardputer-adv -e cardputer-adv-debug' ;; *) echo "Usage: scripts/ci.sh [tests|builds]" >&2; exit 1 ;; esac run_in_container bash -c 'git config --global --add safe.directory "$PWD" && '"$STEPS"