From a345ea589815f9427c0ce7268aa51b2ebb267158 Mon Sep 17 00:00:00 2001 From: ruihan Date: Sat, 20 Jun 2026 15:17:42 -0300 Subject: [PATCH] Add CI.md with local CI docs, update Makefile with ci target --- CI.md | 33 +++++++++++++++++++++++++++++++++ Makefile | 20 ++++++++++++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 CI.md diff --git a/CI.md b/CI.md new file mode 100644 index 0000000..67ecaad --- /dev/null +++ b/CI.md @@ -0,0 +1,33 @@ +# Local CI + +GitHub Actions is configured but requires billing to be resolved on the account. +Until then, run CI locally with one of these methods: + +## Makefile + +```bash +make ci +``` + +Runs ShellCheck, bash syntax check, and markdown lint in sequence. + +## act (Docker-based) + +Requires Docker Desktop running. + +```bash +act -j shellcheck -W .github/workflows/ci.yml --container-architecture linux/amd64 +act -j syntax -W .github/workflows/ci.yml --container-architecture linux/amd64 +act -j markdown -W .github/workflows/ci.yml --container-architecture linux/amd64 +``` + +Or all at once: + +```bash +act --container-architecture linux/amd64 +``` + +## CircleCI + +A `.circleci/config.yml` is included. Connect the repo at https://circleci.com to +use it as a free CI alternative (public repos get 6000 free minutes/month). diff --git a/Makefile b/Makefile index d168141..3b0d058 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -.PHONY: lint test build clean +.PHONY: lint test build clean ci lint: - shellcheck unleash lib/*.sh + shellcheck unleash lib/*.sh 2>/dev/null || brew install shellcheck && shellcheck unleash lib/*.sh bash -n unleash lib/*.sh test: @@ -12,3 +12,19 @@ build: clean: rm -f unleash-standalone.sh + +ci: + @echo "=== ShellCheck ===" && \ + for f in unleash lib/*.sh examples/*.sh; do \ + [ -f "$$f" ] || continue; \ + echo " $$f"; shellcheck -S warning "$$f" || fail=1; \ + done && \ + echo "=== Bash Syntax ===" && \ + for f in unleash lib/*.sh examples/*.sh; do \ + [ -f "$$f" ] || continue; \ + bash -n "$$f" || fail=1; \ + done && \ + echo "=== Markdown ===" && \ + npx markdownlint-cli '*.md' || true && \ + echo "=== All checks done ===" && \ + [ -z "$$fail" ] || exit 1