Skip to content

docs: update .github/workflows/ci.yml via Apex Optimizer #11

docs: update .github/workflows/ci.yml via Apex Optimizer

docs: update .github/workflows/ci.yml via Apex Optimizer #11

Workflow file for this run

# CI Pipeline for DevCore Software Design Principles Handbook
# This workflow is automatically generated by the Apex Technical Authority.
# It enforces the 'Zero-Defect, High-Velocity, Future-Proof' philosophy.
# For details on AI Agent Directives, refer to AGENTS.md.
name: CI Pipeline
# Controls when the workflow will run
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This job builds and tests the handbook content. It's designed for documentation projects.
build_and_test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout repository
uses: actions/checkout@v4
# Setup the latest stable version of Python. Adapt if a specific version is required by the handbook's tooling.
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10' # Assuming Python is used for documentation generation or scripting
# Install necessary dependencies. This step assumes a 'requirements.txt' or similar for documentation tools (e.g., Sphinx, MkDocs).
# Replace with specific package manager commands (e.g., 'poetry install', 'pipenv install') if used.
- name: Install dependencies
run: | # Using pip with a dummy requirements.txt if none exists, or a specific file
python -m pip install --upgrade pip
# Check if requirements.txt exists, otherwise create a dummy one or adapt.
if [ -f requirements.txt ]; then
pip install -r requirements.txt
else
# Placeholder: If no Python dependencies are explicitly needed for CI, this can be skipped or adapted.
echo "No requirements.txt found. Skipping dependency installation."
fi
# Run linters and formatters (e.g., Ruff for Python, or specific linters for Markdown/docs)
# This step assumes Ruff is configured for the project.
- name: Lint and Format Check
run: |
echo "Running Ruff for linting and formatting..."
# Assuming Ruff is installed via requirements.txt or globally
# Ruff's configuration should be in pyproject.toml or ruff.toml
ruff check .
ruff format --check .
# Run tests. For a handbook, this might involve checking links, building the docs, or running specific Python scripts.
# This step assumes Pytest is configured and tests are located appropriately.
- name: Run Tests
run: |
echo "Running Pytest for documentation integrity checks..."
# If Pytest is used for documentation validation (e.g., link checking):
# pytest tests/ # Adjust path to your tests
echo "No specific Pytest command found. Adapt this step to run your documentation build or validation tests."
# Build the documentation. This step is crucial for a handbook repository.
# Example for Sphinx: python -m sphinx -T -b html . _build/html
# Example for MkDocs: mkdocs build
- name: Build Documentation
run: |
echo "Building the software design principles handbook..."
# Placeholder: Replace with actual documentation build command.
# Example for Sphinx:
# python -m pip install sphinx sphinx-rtd-theme
# python -m sphinx . _build/html
# Example for MkDocs:
# python -m pip install mkdocs mkdocs-material
# mkdocs build
echo "Documentation build command needs to be implemented here."
# Optional: Upload documentation artifacts for review or deployment
- name: Upload Documentation Artifact
uses: actions/upload-artifact@v4
with:
name: handbook-html-output
path: _build/html/ # Adjust path based on your documentation build output directory
retention-days: 7 # Keep artifacts for 7 days
# Ensure AGENTS.md compliance checks are integrated if applicable.
# For a handbook, direct CI checks on AGENTS.md might be less relevant than ensuring its content aligns with project standards.
# If AGENTS.md were to govern aspects of the handbook's content generation, a check here would be vital.
- name: Verify AGENTS.md Compliance
run: |
echo "Verifying AGENTS.md aligns with project context..."
# This is a conceptual check. Actual validation would depend on what AGENTS.md governs.
# For this handbook, ensure AGENTS.md accurately reflects Python tooling and documentation standards.
if ! grep -q 'Python 3.10+' AGENTS.md || ! grep -q 'Ruff' AGENTS.md || ! grep -q 'Pytest' AGENTS.md;
then
echo "AGENTS.md does not fully reflect the Python stack (uv, Ruff, Pytest) or documentation focus. Please update AGENTS.md."
exit 1
fi
echo "AGENTS.md compliance confirmed."