Skip to content

Commit ef0e25c

Browse files
committed
Fix missing cache dir crashing cleanup
The cache created by uv is never written to for rust-only workflows, which was leading to a crash when the cleanup step tried removing a non-existent directory.
1 parent 4759c7a commit ef0e25c

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

.github/actions/setup-test-environment/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ inputs:
66
description: "Python version to install"
77
required: false
88
default: "3.10"
9+
enable-uv-cache:
10+
description: "Whether to enable uv caching (disable for jobs that install no Python packages)"
11+
required: false
12+
default: "true"
913

1014
runs:
1115
using: "composite"
@@ -28,3 +32,4 @@ runs:
2832
uses: astral-sh/setup-uv@v7
2933
with:
3034
python-version: ${{ inputs.python-version }}
35+
enable-cache: ${{ inputs.enable-uv-cache }}

.github/workflows/rust.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
uses: actions/checkout@v6
1616
- name: Setup Environment
1717
uses: ./.github/actions/setup-test-environment
18+
with:
19+
enable-uv-cache: false
1820
- name: Check warnings in documents
1921
uses: actions-rs/cargo@v1
2022
with:
@@ -30,6 +32,8 @@ jobs:
3032
uses: actions/checkout@v6
3133
- name: Setup Environment
3234
uses: ./.github/actions/setup-test-environment
35+
with:
36+
enable-uv-cache: false
3337
- name: Run cargo fmt
3438
uses: actions-rs/cargo@v1
3539
with:
@@ -43,6 +47,8 @@ jobs:
4347
uses: actions/checkout@v6
4448
- name: Setup Environment
4549
uses: ./.github/actions/setup-test-environment
50+
with:
51+
enable-uv-cache: false
4652
- name: Check with clippy
4753
uses: actions-rs/clippy-check@v1
4854
with:
@@ -56,6 +62,8 @@ jobs:
5662
uses: actions/checkout@v6
5763
- name: Setup Environment
5864
uses: ./.github/actions/setup-test-environment
65+
with:
66+
enable-uv-cache: false
5967
- name: Run tests
6068
uses: actions-rs/cargo@v1
6169
with:

0 commit comments

Comments
 (0)