Skip to content

Commit

Permalink
ci: refine job matrix and enable cache for poetry (#1381)
Browse files Browse the repository at this point in the history
* ci: refine job matrix and enable cache for poetry

- Replace direct installation of Poetry with pipx to ensure isolated environment setups.
- Enable caching for Poetry dependencies using setup-python action to improve build efficiency.
- Refactor the job matrix specifications.

* ci: enable Homebrew caching in Actions

* ci: optimize Docker and Colima installation in GitHub Actions

- Check if Docker and Colima are already installed before attempting to install them. Link and start each service appropriately to avoid unnecessary reinstallation and ensure they are ready for immediate use in the CI pipeline.

* ci: remove Homebrew cache.

* fix typo

* fix: specified the Python version to avoid errors in actions.

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 29, 2024
1 parent 8954855 commit 03ecec1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 56 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
72 changes: 25 additions & 47 deletions .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
33 changes: 24 additions & 9 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down

0 comments on commit 03ecec1

Please sign in to comment.