From ec0711e0b5eb03de9ff3f59ce34d68c4d211560d Mon Sep 17 00:00:00 2001 From: Umpire2018 <138990495+Umpire2018@users.noreply.github.com> Date: Fri, 26 Apr 2024 08:35:37 +0000 Subject: [PATCH 1/6] 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. --- .github/workflows/lint.yml | 1 + .github/workflows/run-integration-tests.yml | 60 +++++++-------------- .github/workflows/run-unit-tests.yml | 34 ++++++++---- 3 files changed, 46 insertions(+), 49 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dd9b24e9f3e..97a50b36e64 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,6 +32,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 8297cf4d61c..a00a92b53df 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -6,58 +6,38 @@ jobs: on-linux: 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" + - agent: "SWEAgent" embedding-model: "none" - sandbox: "ssh" - - name: SWEAgent-py311-exec - python-version: "3.11" - agent: "SWEAgent" + - agent: "PlannerAgent" embedding-model: "none" - sandbox: "exec" - - name: PlannerAgent-py311-exec - python-version: "3.11" - agent: "PlannerAgent" + - agent: "CodeActAgent" 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" - embedding-model: "none" - sandbox: "exec" 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 + - 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 fc6e6cf3656..16cf54f6ee9 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -11,22 +11,30 @@ 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 + on-linux: runs-on: ubuntu-latest strategy: @@ -35,13 +43,21 @@ 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 From 42c34ae37e5a25c6a26ed4c95005a837cba02124 Mon Sep 17 00:00:00 2001 From: Umpire2018 <138990495+Umpire2018@users.noreply.github.com> Date: Sat, 27 Apr 2024 01:22:12 +0000 Subject: [PATCH 2/6] ci: enable Homebrew caching in Actions --- .github/workflows/run-unit-tests.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index 16cf54f6ee9..3d301fb706a 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -24,9 +24,25 @@ jobs: - name: Install Python dependencies using Poetry run: poetry install - - name: Install & Start Docker + - name: Set up Homebrew cache + uses: actions/cache@v4 + with: + path: | + /usr/local/Homebrew + /usr/local/Cellar + /usr/local/Caskroom + ~/Library/Caches/Homebrew + key: ${{ runner.os }}-homebrew-${{ hashFiles('**/*.rb') }} + restore-keys: | + ${{ runner.os }}-homebrew- + + - name: Install Docker CLI and Colima + run: | + brew install docker + brew install colima + + - name: Start Colima run: | - brew install colima docker colima start - name: Build Environment From 36648a3cbc691f8e01590e186cd8b611b978e091 Mon Sep 17 00:00:00 2001 From: Umpire2018 <138990495+Umpire2018@users.noreply.github.com> Date: Sat, 27 Apr 2024 06:48:24 +0000 Subject: [PATCH 3/6] 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. --- .github/workflows/run-unit-tests.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index 3d301fb706a..af15a7b6c45 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -36,13 +36,19 @@ jobs: restore-keys: | ${{ runner.os }}-homebrew- - - name: Install Docker CLI and Colima + - name: Install and link Docker CLI run: | - brew install docker - brew install colima + if ! brew list docker &>/dev/null; then + brew install docker + fi + brew link docker - - name: Start Colima + - name: Install and start Colima run: | + if ! brew list colima &>/dev/null; then + brew install colima + fi + brew link colima colima start - name: Build Environment From b7e61adb3af24754c42b59d2e79559019e8bf2e9 Mon Sep 17 00:00:00 2001 From: Umpire2018 <138990495+Umpire2018@users.noreply.github.com> Date: Sat, 27 Apr 2024 06:58:37 +0000 Subject: [PATCH 4/6] ci: remove Homebrew cache. --- .github/workflows/run-unit-tests.yml | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index af15a7b6c45..16cf54f6ee9 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -24,31 +24,9 @@ jobs: - name: Install Python dependencies using Poetry run: poetry install - - name: Set up Homebrew cache - uses: actions/cache@v4 - with: - path: | - /usr/local/Homebrew - /usr/local/Cellar - /usr/local/Caskroom - ~/Library/Caches/Homebrew - key: ${{ runner.os }}-homebrew-${{ hashFiles('**/*.rb') }} - restore-keys: | - ${{ runner.os }}-homebrew- - - - name: Install and link Docker CLI - run: | - if ! brew list docker &>/dev/null; then - brew install docker - fi - brew link docker - - - name: Install and start Colima + - name: Install & Start Docker run: | - if ! brew list colima &>/dev/null; then - brew install colima - fi - brew link colima + brew install colima docker colima start - name: Build Environment From c0c6e2f96ef952f12be2c894a25c00e22987ff25 Mon Sep 17 00:00:00 2001 From: Umpire2018 <138990495+Umpire2018@users.noreply.github.com> Date: Sat, 27 Apr 2024 07:34:17 +0000 Subject: [PATCH 5/6] fix typo --- .github/workflows/run-integration-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 16975cd35a8..f2a15ba7400 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -11,6 +11,7 @@ jobs: python-version: ["3.11"] agent: ["SWEAgent", "PlannerAgent", "MonologueAgent", "CodeActAgent"] sandbox: ["ssh", "exec"] + include: - agent: "MonologueAgent" embedding-model: "local" - agent: "MonologueAgent" From ea8b19f916388c9ef45fa47a16796ecacdd3cbc7 Mon Sep 17 00:00:00 2001 From: Umpire2018 <138990495+Umpire2018@users.noreply.github.com> Date: Sat, 27 Apr 2024 14:11:40 +0000 Subject: [PATCH 6/6] fix: specified the Python version to avoid errors in actions. --- .github/workflows/run-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index f2a15ba7400..030626367dc 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: '3.11' cache: 'poetry' - name: Install Python dependencies using Poetry