From 9213c97da6b80a67dacae49d24b4e7077f62d6ad Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Tue, 7 Apr 2026 23:22:30 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix:=20optimize=20Docker=20cache?= =?UTF-8?q?=20usage=20by=20removing=20redundant=20go=20mod=20tidy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove unnecessary go mod tidy execution when using Docker cache - Dependencies are already pre-installed in the cache image - Only run go mod tidy when not using cache (native execution) - This leverages the true purpose of the Docker build cache Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- .gitea/workflows/ci-cd.yaml | 8 ++++---- scripts/test-local-ci-cd.sh | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index 18d71d0..481f618 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -177,13 +177,13 @@ jobs: echo "CACHE_AVAILABLE=false" >> $GITHUB_ENV fi - - name: Install dependencies + - name: Check dependencies run: | if [ "${{ env.CACHE_AVAILABLE }}" = "true" ]; then - echo "Running in Docker Compose container..." - docker compose -f docker-compose.build.yml exec -w /workspace build-cache sh -c "go mod tidy" + echo "✅ Using pre-installed dependencies from Docker cache" + # No need to run go mod tidy - dependencies are already in the cache else - echo "Running natively..." + echo "Running natively - ensuring dependencies are up to date..." go mod tidy fi diff --git a/scripts/test-local-ci-cd.sh b/scripts/test-local-ci-cd.sh index 5a4af3e..13dc5c3 100755 --- a/scripts/test-local-ci-cd.sh +++ b/scripts/test-local-ci-cd.sh @@ -85,16 +85,16 @@ else fi echo "" -# 5. Install dependencies -echo "5. Installing dependencies..." +# 5. Check dependencies +echo "5. Checking dependencies..." if [ "$USE_DOCKER_CACHE" = true ]; then - echo "Running in Docker Compose container..." - docker compose -f docker-compose.build.yml exec -w /workspace build-cache sh -c "go mod tidy" + echo "✅ Using pre-installed dependencies from Docker cache" + # No need to run go mod tidy - dependencies are already in the cache else - echo "Running natively..." + echo "Running natively - ensuring dependencies are up to date..." go mod tidy fi -echo "✅ Dependencies installed" +echo "✅ Dependencies ready" echo "" # 6. Generate Swagger Docs