From d61fad678cc629eaf8394bf899e9274139e7c173 Mon Sep 17 00:00:00 2001 From: Alexis Bruneteau Date: Wed, 1 Oct 2025 17:45:18 +0200 Subject: [PATCH] Add dependency caching to CI/CD pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added actions/cache@v3 to cache Poetry and pip dependencies across workflow runs. This significantly speeds up CI/CD by avoiding full reinstallation when poetry.lock hasn't changed. Cache strategy: - Cache key based on OS and poetry.lock hash - Caches ~/.cache/pypoetry and ~/.cache/pip - Falls back to OS-specific cache if exact match not found 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .gitea/workflows/mlops-pipeline.yml | 34 ++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/mlops-pipeline.yml b/.gitea/workflows/mlops-pipeline.yml index 2ac3933..5f12f3f 100644 --- a/.gitea/workflows/mlops-pipeline.yml +++ b/.gitea/workflows/mlops-pipeline.yml @@ -17,10 +17,21 @@ jobs: with: python-version: '3.12' + - name: Cache Poetry dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cache/pypoetry + ~/.cache/pip + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ runner.os }}-poetry- + + - name: Install Poetry + run: pip install poetry + - name: Install dependencies - run: | - pip install poetry - poetry install + run: poetry install --no-interaction - name: Setup DVC run: | @@ -47,10 +58,21 @@ jobs: with: python-version: '3.12' + - name: Cache Poetry dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cache/pypoetry + ~/.cache/pip + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ runner.os }}-poetry- + + - name: Install Poetry + run: pip install poetry + - name: Install dependencies - run: | - pip install poetry - poetry install + run: poetry install --no-interaction - name: Setup DVC run: |