-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (79 loc) · 3.08 KB
/
ci.yml
File metadata and controls
88 lines (79 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# .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 }}