Skip to content

πŸ™Œ OpenHands: AI-Driven Development

ci: refine job matrix and enable cache for poetry (#1381)

Arno.Edwards03ecec1e763d
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index b95514649c..e16043e044 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -37,6 +37,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.11
+ cache: 'pip'
- name: Install pre-commit
run: pip install pre-commit==3.7.0
- name: Run pre-commit hooks
diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml
index b476b27c47..5af6966d35 100644
--- a/.github/workflows/run-integration-tests.yml
+++ b/.github/workflows/run-integration-tests.yml
@@ -11,64 +11,42 @@ jobs:
name: Integration Tests
runs-on: ubuntu-latest
strategy:
+ fail-fast: false
matrix:
+ python-version: ["3.11"]
+ agent: ["SWEAgent", "PlannerAgent", "MonologueAgent", "CodeActAgent"]
+ sandbox: ["ssh", "exec"]
include:
- - name: SWEAgent-py311-ssh
- python-version: "3.11"
- agent: "SWEAgent"
- embedding-model: "none"
- sandbox: "ssh"
- - name: PlannerAgent-py311-ssh
- python-version: "3.11"
- agent: "PlannerAgent"
- embedding-model: "none"
- sandbox: "ssh"
- - name: MonologueAgent-py311-ssh
- python-version: "3.11"
- agent: "MonologueAgent"
+ - agent: "MonologueAgent"
embedding-model: "local"
- sandbox: "ssh"
- - name: CodeActAgent-py311-ssh
- python-version: "3.11"
- agent: "CodeActAgent"
- embedding-model: "none"
- sandbox: "ssh"
- - name: SWEAgent-py311-exec
- python-version: "3.11"
- agent: "SWEAgent"
+ - agent: "MonologueAgent"
+ # sufficient to have one agent testing against local sandbox
+ sandbox: "local"
+ embedding-model: "local"
+ - agent: "SWEAgent"
embedding-model: "none"
- sandbox: "exec"
- - name: PlannerAgent-py311-exec
- python-version: "3.11"
- agent: "PlannerAgent"
+ - agent: "PlannerAgent"
embedding-model: "none"
- sandbox: "exec"
- - name: MonologueAgent-py311-exec
- python-version: "3.11"
- agent: "MonologueAgent"
- embedding-model: "local"
- sandbox: "exec"
- - name: CodeActAgent-py311-exec
- python-version: "3.11"
- agent: "CodeActAgent"
+ - agent: "CodeActAgent"
embedding-model: "none"
- sandbox: "exec"
- - name: MonologueAgent-py311-local
- python-version: "3.11"
- agent: "MonologueAgent"
- embedding-model: "local"
- # sufficient to have one agent testing against local sandbox
- sandbox: "local"
steps:
- uses: actions/checkout@v4
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
+
+ - name: Install poetry via pipx
+ run: pipx install poetry
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
with:
- python-version: ${{ matrix.python-version }}
- - name: Install Poetry
- run: curl -sSL https://install.python-poetry.org | python3 -
+ python-version: '3.11'
+ cache: 'poetry'
+
+ - name: Install Python dependencies using Poetry
+ run: poetry install
+
- name: Build Environment
run: make build
+
- name: Run Integration Tests
env:
SANDBOX_TYPE: ${{ matrix.sandbox }}
diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml
index 16bb0cc470..db0c3ce3d7 100644
--- a/.github/workflows/run-unit-tests.yml
+++ b/.github/workflows/run-unit-tests.yml
@@ -16,20 +16,27 @@ jobs:
steps:
- uses: actions/checkout@v4
+
+ - name: Install poetry via pipx
+ run: pipx install poetry
+
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
+ cache: 'poetry'
+
+ - name: Install Python dependencies using Poetry
+ run: poetry install
+
- name: Install & Start Docker
run: |
brew install colima docker
colima start
- - name: Install and configure Poetry
- uses: snok/install-poetry@v1
- with:
- version: latest
+
- name: Build Environment
run: make build
+
- name: Run Tests
run: poetry run pytest ./tests/unit
test-on-linux:
@@ -41,14 +48,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
+
+ - name: Install poetry via pipx
+ run: pipx install poetry
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- - name: Install Poetry
- run: curl -sSL https://install.python-poetry.org | python3 -
+ cache: 'poetry'
+
+ - name: Install Python dependencies using Poetry
+ run: poetry install --without evaluation
+
- name: Build Environment
run: make build
+
- name: Run Tests
run: poetry run pytest ./tests/unit