Skip to content

Merge pull request #28 from alfredolopez80/fix/ci-pytest-fail-loud #409

Merge pull request #28 from alfredolopez80/fix/ci-pytest-fail-loud

Merge pull request #28 from alfredolopez80/fix/ci-pytest-fail-loud #409

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
validate:
name: Validate Scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y shellcheck jq curl
- name: Validate shell syntax
run: |
# Validate ralph
bash -n scripts/ralph
# Validate ralph-doctor
bash -n scripts/ralph-doctor.sh
# Validate install script
bash -n install.sh
- name: Run shellcheck
run: |
# Check all bash scripts (with some exceptions for sourced files)
shellcheck --severity=warning \
scripts/ralph-doctor.sh \
scripts/ralph \
install.sh || true
- name: Check executable permissions
run: |
# Ensure hooks are executable
chmod +x .claude/hooks/*.sh
chmod +x scripts/ralph
chmod +x scripts/ralph-doctor.sh
- name: Validate hooks structure
run: |
# Check hooks exist
test -d .claude/hooks
# Verify all hooks use a supported runtime extension.
# Hooks are polyglot: Bash (.sh), Python (.py), and Node (.js/.mjs).
for hook in .claude/hooks/*; do
[ -f "$hook" ] || continue
case "$hook" in
*.sh|*.py|*.js|*.mjs) ;;
*)
echo "ERROR: Hook $hook has unsupported extension (expected .sh, .py, .js, or .mjs)"
exit 1
;;
esac
done
- name: Validate skills structure
run: |
# Check all skills have SKILL.md
for skill_dir in .claude/skills/*/; do
if [ -d "$skill_dir" ]; then
if [ ! -f "${skill_dir}SKILL.md" ]; then
echo "ERROR: Skill $(basename "$skill_dir") missing SKILL.md"
exit 1
fi
fi
done
echo "✅ All skills have SKILL.md"
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install test dependencies
run: |
pip install pytest pytest-cov
- name: Run pytest
run: |
if [ -d "tests" ]; then
python -m pytest tests/ -v --tb=short
fi
- name: Run harness tests
run: |
if [ -d "tests/harness" ]; then
python -m pytest tests/harness/ -v --tb=short
fi
health-check:
name: Ralph Doctor
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ralph-doctor (quick mode)
run: |
bash scripts/ralph-doctor.sh --quick || true