From f03be69a70860b2258e0881324cc94794aef031c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Wed, 28 Jan 2026 14:01:54 +0100 Subject: [PATCH 1/3] ci: Enable uv caching in GitHub workflows Add `enable-cache: true` to all uv setup steps across workflows to speed up CI runs by caching downloaded packages and wheels. Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/build-deploy-docs.yml | 1 + .github/workflows/release.yml | 1 + .github/workflows/tests.yml | 3 +++ 3 files changed, 5 insertions(+) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 337b143b..d7e6980b 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -24,6 +24,7 @@ jobs: uses: astral-sh/setup-uv@v5 with: python-version: '3.14' + enable-cache: true - uses: ./.github/actions/install-deps with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 02cc877d..c25dcbcc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,7 @@ jobs: uses: astral-sh/setup-uv@v5 with: python-version: '3.14' + enable-cache: true - name: Build run: uv build diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84b562d9..d11ea31c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,6 +41,7 @@ jobs: uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version || '3.14' }} + enable-cache: true - uses: ./.github/actions/install-deps with: @@ -68,6 +69,7 @@ jobs: uses: astral-sh/setup-uv@v5 with: python-version: '3.14' + enable-cache: true - uses: ./.github/actions/install-deps with: @@ -88,6 +90,7 @@ jobs: uses: astral-sh/setup-uv@v5 with: python-version: '3.14' + enable-cache: true - uses: ./.github/actions/install-deps with: From 72caebd3128d77310e37fc2cd752e5af9fde1f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Wed, 28 Jan 2026 14:06:10 +0100 Subject: [PATCH 2/3] ci: Configure uv cache to use pyproject.toml Add `cache-dependency-glob: "**/pyproject.toml"` to fix cache invalidation warning. Since this is a library without a lock file, the cache will invalidate when pyproject.toml changes. Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/build-deploy-docs.yml | 1 + .github/workflows/release.yml | 1 + .github/workflows/tests.yml | 3 +++ 3 files changed, 5 insertions(+) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index d7e6980b..11bac692 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -25,6 +25,7 @@ jobs: with: python-version: '3.14' enable-cache: true + cache-dependency-glob: "**/pyproject.toml" - uses: ./.github/actions/install-deps with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c25dcbcc..1bf784c0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,7 @@ jobs: with: python-version: '3.14' enable-cache: true + cache-dependency-glob: "**/pyproject.toml" - name: Build run: uv build diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d11ea31c..b4869056 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,6 +42,7 @@ jobs: with: python-version: ${{ matrix.python-version || '3.14' }} enable-cache: true + cache-dependency-glob: "**/pyproject.toml" - uses: ./.github/actions/install-deps with: @@ -70,6 +71,7 @@ jobs: with: python-version: '3.14' enable-cache: true + cache-dependency-glob: "**/pyproject.toml" - uses: ./.github/actions/install-deps with: @@ -91,6 +93,7 @@ jobs: with: python-version: '3.14' enable-cache: true + cache-dependency-glob: "**/pyproject.toml" - uses: ./.github/actions/install-deps with: From a3c7044f7db00b8752420b8918be039c7d1633d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Wed, 28 Jan 2026 14:10:38 +0100 Subject: [PATCH 3/3] refactor: Extract uv setup into reusable local action Create `.github/actions/setup-uv` to factorize the repeated uv setup configuration across workflows. This includes the caching settings and makes it easier to maintain consistent uv setup. Co-Authored-By: Claude Sonnet 4.5 --- .github/actions/setup-uv/action.yml | 18 ++++++++++++++++++ .github/workflows/build-deploy-docs.yml | 7 +------ .github/workflows/release.yml | 7 +------ .github/workflows/tests.yml | 19 +++---------------- 4 files changed, 23 insertions(+), 28 deletions(-) create mode 100644 .github/actions/setup-uv/action.yml diff --git a/.github/actions/setup-uv/action.yml b/.github/actions/setup-uv/action.yml new file mode 100644 index 00000000..52cae258 --- /dev/null +++ b/.github/actions/setup-uv/action.yml @@ -0,0 +1,18 @@ +name: Setup uv +description: Setup uv with caching enabled + +inputs: + python-version: + description: 'Python version to use' + required: false + default: '3.14' + +runs: + using: composite + steps: + - name: Set up uv + uses: astral-sh/setup-uv@v5 + with: + python-version: ${{ inputs.python-version }} + enable-cache: true + cache-dependency-glob: "**/pyproject.toml" diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 11bac692..970e1feb 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -20,12 +20,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up uv - uses: astral-sh/setup-uv@v5 - with: - python-version: '3.14' - enable-cache: true - cache-dependency-glob: "**/pyproject.toml" + - uses: ./.github/actions/setup-uv - uses: ./.github/actions/install-deps with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1bf784c0..31addf3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up uv - uses: astral-sh/setup-uv@v5 - with: - python-version: '3.14' - enable-cache: true - cache-dependency-glob: "**/pyproject.toml" + - uses: ./.github/actions/setup-uv - name: Build run: uv build diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b4869056..362b7dd3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,12 +37,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up uv - uses: astral-sh/setup-uv@v5 + - uses: ./.github/actions/setup-uv with: python-version: ${{ matrix.python-version || '3.14' }} - enable-cache: true - cache-dependency-glob: "**/pyproject.toml" - uses: ./.github/actions/install-deps with: @@ -66,12 +63,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up uv - uses: astral-sh/setup-uv@v5 - with: - python-version: '3.14' - enable-cache: true - cache-dependency-glob: "**/pyproject.toml" + - uses: ./.github/actions/setup-uv - uses: ./.github/actions/install-deps with: @@ -88,12 +80,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up uv - uses: astral-sh/setup-uv@v5 - with: - python-version: '3.14' - enable-cache: true - cache-dependency-glob: "**/pyproject.toml" + - uses: ./.github/actions/setup-uv - uses: ./.github/actions/install-deps with: