Files
runaway/.github/workflows/ci.yml
T

65 lines
1.9 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install ShellCheck
run: |
if command -v shellcheck >/dev/null 2>&1; then
echo "shellcheck already available"
exit 0
fi
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck
else
echo "no apt-get on this runner — ShellCheck will be skipped"
fi
- name: Run ShellCheck
run: |
command -v shellcheck >/dev/null 2>&1 || { echo "shellcheck unavailable — skipping"; exit 0; }
for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue
echo "Checking: $f"
shellcheck -S warning -s bash "$f" || exit 1
done
syntax:
name: Bash Syntax Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Check syntax
run: |
for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue
echo "Checking: $f"
bash -n "$f" || exit 1
done
echo "All files pass syntax check"
markdown:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install markdownlint (best effort)
run: |
if command -v npm >/dev/null 2>&1; then
npm install -g markdownlint-cli 2>/dev/null || echo "npm install failed — lint will be skipped"
else
echo "npm not available on this runner — lint will be skipped"
fi
- name: Lint markdown
run: |
command -v markdownlint >/dev/null 2>&1 || { echo "markdownlint unavailable — skipping"; exit 0; }
markdownlint '*.md' --config /dev/null || true