Explorar el Código

feat(makefile): add capability to skip Docker image pull (#1463)

* feat(makefile): add capability to skip Docker image pull

* ci(github-actions): add conditional Docker installation based on ENV variable
Arno.Edwards hace 1 año
padre
commit
442ab7371c
Se han modificado 2 ficheros con 13 adiciones y 0 borrados
  1. 9 0
      .github/workflows/run-unit-tests.yml
  2. 4 0
      Makefile

+ 9 - 0
.github/workflows/run-unit-tests.yml

@@ -10,6 +10,8 @@ jobs:
   test-on-macos:
   test-on-macos:
     name: Test on macOS
     name: Test on macOS
     runs-on: macos-13
     runs-on: macos-13
+    env:
+      INSTALL_DOCKER: '0'  # Set to '0' to skip Docker installation
     strategy:
     strategy:
       matrix:
       matrix:
         python-version: ["3.11"]
         python-version: ["3.11"]
@@ -30,6 +32,7 @@ jobs:
         run: poetry install
         run: poetry install
 
 
       - name: Install & Start Docker
       - name: Install & Start Docker
+        if: env.INSTALL_DOCKER == '1'
         run: |
         run: |
           brew install colima docker
           brew install colima docker
           colima start
           colima start
@@ -40,6 +43,8 @@ jobs:
 
 
       - name: Build Environment
       - name: Build Environment
         run: make build
         run: make build
+        env:
+          SKIP_DOCKER_PULL: 1
 
 
       - name: Run Tests
       - name: Run Tests
         run: poetry run pytest --cov=agenthub --cov=opendevin --cov-report=xml ./tests/unit
         run: poetry run pytest --cov=agenthub --cov=opendevin --cov-report=xml ./tests/unit
@@ -51,6 +56,8 @@ jobs:
   test-on-linux:
   test-on-linux:
     name: Test on Linux
     name: Test on Linux
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
+    env:
+      SKIP_DOCKER_PULL: 1  # Set to 0 to pull Docker images
     strategy:
     strategy:
       matrix:
       matrix:
         python-version: ["3.11"]
         python-version: ["3.11"]
@@ -72,6 +79,8 @@ jobs:
 
 
       - name: Build Environment
       - name: Build Environment
         run: make build
         run: make build
+        env:
+          SKIP_DOCKER_PULL: 1
 
 
       - name: Run Tests
       - name: Run Tests
         run: poetry run pytest --cov=agenthub --cov=opendevin --cov-report=xml ./tests/unit
         run: poetry run pytest --cov=agenthub --cov=opendevin --cov-report=xml ./tests/unit

+ 4 - 0
Makefile

@@ -22,7 +22,9 @@ RESET=$(shell tput -Txterm sgr0)
 build:
 build:
 	@echo "$(GREEN)Building project...$(RESET)"
 	@echo "$(GREEN)Building project...$(RESET)"
 	@$(MAKE) -s check-dependencies
 	@$(MAKE) -s check-dependencies
+ifeq ($(SKIP_DOCKER_PULL),)
 	@$(MAKE) -s pull-docker-image
 	@$(MAKE) -s pull-docker-image
+endif
 	@$(MAKE) -s install-python-dependencies
 	@$(MAKE) -s install-python-dependencies
 	@$(MAKE) -s install-frontend-dependencies
 	@$(MAKE) -s install-frontend-dependencies
 	@$(MAKE) -s install-precommit-hooks
 	@$(MAKE) -s install-precommit-hooks
@@ -35,7 +37,9 @@ check-dependencies:
 	@$(MAKE) -s check-python
 	@$(MAKE) -s check-python
 	@$(MAKE) -s check-npm
 	@$(MAKE) -s check-npm
 	@$(MAKE) -s check-nodejs
 	@$(MAKE) -s check-nodejs
+ifeq ($(SKIP_DOCKER_PULL),)
 	@$(MAKE) -s check-docker
 	@$(MAKE) -s check-docker
+endif
 	@$(MAKE) -s check-poetry
 	@$(MAKE) -s check-poetry
 	@echo "$(GREEN)Dependencies checked successfully.$(RESET)"
 	@echo "$(GREEN)Dependencies checked successfully.$(RESET)"