Merge pull request #50 from renbytes/dev-mkdocsFix #146
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
| # .github/workflows/ci.yml | |
| name: Continuous Integration | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| ci: | |
| # The job name will be dynamically set based on the matrix task name | |
| name: ${{ matrix.task.name }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| # This ensures that if one matrix job fails, the others will continue to run | |
| fail-fast: false | |
| matrix: | |
| task: | |
| - name: "Lint & Format" | |
| run_command: | | |
| poetry run ruff check . | |
| poetry run ruff format --check . | |
| - name: "Type Checking" | |
| run_command: poetry run mypy agent-core agent-engine agent-concurrent agent-persist agent-sim | |
| - name: "Run Tests & Check Coverage" | |
| run_command: poetry run pytest --cov=agent_core --cov=agent_engine --cov-report=term-missing --cov-fail-under=80 | |
| # Add a flag to indicate that this specific task needs graphviz | |
| needs_graphviz: true | |
| steps: | |
| - name: "Checkout code" | |
| uses: actions/checkout@v4 | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11.9" | |
| # Install system dependencies FIRST, before Poetry installation | |
| - name: "Install system dependencies" | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| graphviz \ | |
| graphviz-dev \ | |
| libgraphviz-dev \ | |
| pkg-config | |
| - name: "Install Poetry" | |
| run: | | |
| curl -sSL https://install.python-poetry.org | python3 - | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: "Configure Poetry" | |
| run: | | |
| poetry config virtualenvs.create true | |
| poetry config virtualenvs.in-project true | |
| - name: "Cache Poetry dependencies" | |
| uses: actions/cache@v4 | |
| with: | |
| path: .venv | |
| # Include pyproject.toml in cache key to invalidate when dependencies change | |
| key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock', '**/pyproject.toml') }}-v3 | |
| restore-keys: | | |
| poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock', '**/pyproject.toml') }}-v3 | |
| poetry-${{ runner.os }}- | |
| - name: "Clean corrupted packages and install dependencies" | |
| run: | | |
| # Clean any corrupted mlflow packages that might exist | |
| if [ -d ".venv" ]; then | |
| poetry run pip uninstall mlflow mlflow-skinny mlflow-tracing -y || true | |
| fi | |
| # Install dependencies with retry logic | |
| poetry install --no-cache || { | |
| echo "Installation failed, cleaning environment and retrying..." | |
| poetry env remove --all || true | |
| poetry install --no-cache | |
| } | |
| - name: "Verify installation" | |
| run: | | |
| poetry run python -c "import sys; print('Python version:', sys.version)" | |
| poetry run python -c "import pygraphviz; print('pygraphviz version:', pygraphviz.__version__)" | |
| - name: "Run Task" | |
| run: ${{ matrix.task.run_command }} |