Enhance README with visual improvements and codify documentation stan… #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| pre-commit: | |
| name: Pre-commit Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install pre-commit | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pre-commit | |
| - name: Run pre-commit (fast path) | |
| id: precommit_fast | |
| run: | | |
| pre-commit run --all-files | |
| - name: Generate pre-commit log (only on failure) | |
| if: failure() && steps.precommit_fast.outcome == 'failure' | |
| run: | | |
| chmod +x scripts/run-precommit.sh | |
| ./scripts/run-precommit.sh | |
| - name: Upload pre-commit log artifact (only on failure) | |
| if: failure() && steps.precommit_fast.outcome == 'failure' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pre-commit-log | |
| path: artifacts/pre-commit.log | |
| tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| needs: [pre-commit] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install repo dependencies if present | |
| if [ -f requirements.txt ]; then | |
| pip install -r requirements.txt | |
| fi | |
| if [ -f requirements-dev.txt ]; then | |
| pip install -r requirements-dev.txt | |
| fi | |
| # Only install pytest if tests exist | |
| if [ -d tests ]; then | |
| pip install pytest | |
| fi | |
| - name: Run pytest (if tests exist) | |
| run: | | |
| if [ -d tests ]; then | |
| pytest -q | |
| else | |
| echo "No tests/ directory found; skipping pytest." | |
| fi |