From 41cbd97b483c03f6910232fe32deae79ef226eb8 Mon Sep 17 00:00:00 2001 From: Ludy Date: Sat, 29 Aug 2026 14:50:11 +0000 Subject: [PATCH] ci: reuse shared Python dependency cache across workflows (#7693) # Description of Changes This PR removes workflow-specific cache suffixes from Python dependency caching in several CI workflows. Previously, the following workflows appended their own `cache-suffix` even though they use the same Python dependency files: - `ai-engine.yml` - `check-generated-models.yml` - `pre_commit.yml` - `sync_files_v2.yml` All of these workflows use the same cache dependency inputs: - `engine/pyproject.toml` - `engine/uv.lock` The workflow-specific suffixes caused separate cache entries to be created for effectively identical dependency sets. This resulted in unnecessary cache duplication and reduced cache reuse between workflows. By removing the suffixes, these workflows can now share the same cache when their dependency inputs and other cache key components match. This change reduces redundant cache storage, improves cache hit potential across CI workflows, and avoids repeatedly creating equivalent caches under different names. No functional application behavior is changed. The modification only affects CI cache key generation and reuse. --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have run `task check` to verify linters, typechecks, and tests pass - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#7-testing) for more details. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ai-engine.yml | 1 - .github/workflows/check-generated-models.yml | 1 - .github/workflows/pre_commit.yml | 1 - .github/workflows/sync_files_v2.yml | 1 - 4 files changed, 4 deletions(-) diff --git a/.github/workflows/ai-engine.yml b/.github/workflows/ai-engine.yml index caa5af1acb..357dfa1e49 100644 --- a/.github/workflows/ai-engine.yml +++ b/.github/workflows/ai-engine.yml @@ -34,7 +34,6 @@ jobs: cache-dependency-glob: | engine/pyproject.toml engine/uv.lock - cache-suffix: ai-engine - name: Install Task uses: go-task/setup-task@01a4adf9db2d14c1de7a560f09170b6e0df736aa # v2.1.0 diff --git a/.github/workflows/check-generated-models.yml b/.github/workflows/check-generated-models.yml index 476f9d21a7..f917a4c602 100644 --- a/.github/workflows/check-generated-models.yml +++ b/.github/workflows/check-generated-models.yml @@ -42,7 +42,6 @@ jobs: cache-dependency-glob: | engine/pyproject.toml engine/uv.lock - cache-suffix: generated-models - name: Restore cache Gradle User Home if: inputs.use_shared_cache diff --git a/.github/workflows/pre_commit.yml b/.github/workflows/pre_commit.yml index 3566f5864f..fbd9efc474 100644 --- a/.github/workflows/pre_commit.yml +++ b/.github/workflows/pre_commit.yml @@ -31,7 +31,6 @@ jobs: cache-dependency-glob: | engine/pyproject.toml engine/uv.lock - cache-suffix: pre-commit - name: Install Task uses: go-task/setup-task@01a4adf9db2d14c1de7a560f09170b6e0df736aa # v2.1.0 diff --git a/.github/workflows/sync_files_v2.yml b/.github/workflows/sync_files_v2.yml index a199fd6cbd..f688476159 100644 --- a/.github/workflows/sync_files_v2.yml +++ b/.github/workflows/sync_files_v2.yml @@ -59,7 +59,6 @@ jobs: cache-dependency-glob: | engine/pyproject.toml engine/uv.lock - cache-suffix: sync-files - name: Install Python dependencies run: |