Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
7e6ecf7c94 chore(deps-dev): bump js-yaml from 4.1.1 to 5.2.1
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.1 to 5.2.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.1...5.2.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 5.2.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-20 10:53:54 +00:00
7 changed files with 38 additions and 28 deletions

View File

@@ -100,7 +100,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
cache-local-path: ""
# Prune cache before saving
prune-cache: "false"
prune-cache: "true"
# Upload managed Python installations to the GitHub Actions cache
cache-python: "false"

View File

@@ -62,13 +62,13 @@ describe("restoreCache", () => {
expect(cacheKey).toContain("-tests-3.10%2C3.11");
});
it("uses an unpruned cache key by default", async () => {
it("keeps cache keys unchanged for exact Python versions and simple suffixes", async () => {
const inputs = createSetupInputs({ cacheSuffix: "tests-3.11" });
await restoreCache(inputs, "3.11");
expect(cacheKeyOutput()).toBe(
"setup-uv-2-x86_64-unknown-linux-gnu-ubuntu-24.04-3.11-dependencyhash-tests-3.11",
"setup-uv-2-x86_64-unknown-linux-gnu-ubuntu-24.04-3.11-pruned-dependencyhash-tests-3.11",
);
});
});

View File

@@ -20,7 +20,7 @@ export function createSetupInputs(
ignoreEmptyWorkdir: false,
ignoreNothingToCache: false,
noProject: false,
pruneCache: false,
pruneCache: true,
pythonDir: "/tmp/uv-python-dir",
pythonVersion: "",
quiet: false,

View File

@@ -61,7 +61,7 @@ inputs:
default: ""
prune-cache:
description: "Prune cache before saving."
default: "false"
default: "true"
cache-python:
description: "Upload managed Python installations to the Github Actions cache."
default: "false"

View File

@@ -33,8 +33,8 @@ The computed cache key is available as the `cache-key` output:
## Enable caching
> [!NOTE]
> The entire uv cache is uploaded to the GitHub Actions cache by default. To reduce the cache size,
> see [Enable cache pruning](#enable-cache-pruning).
> The cache is pruned before it is uploaded to the GitHub Actions cache. This can lead to
> a small or empty cache. See [Disable cache pruning](#disable-cache-pruning) for more details.
If you enable caching, the [uv cache](https://docs.astral.sh/uv/concepts/cache/) will be uploaded to
the GitHub Actions cache. This can speed up runs that reuse the cache by several minutes.
@@ -173,29 +173,30 @@ It defaults to `setup-uv-cache` in the `TMP` dir, `D:\a\_temp\setup-uv-cache` on
cache-local-path: "/path/to/cache"
```
## Enable cache pruning
## Disable cache pruning
By default, the entire uv cache is persisted across runs. On GitHub-hosted runners, it's typically
faster to prune the cache before saving it, removing pre-built wheels, but retaining any wheels that
were built from source. The pre-built wheels are then re-downloaded from the registry on each run.
See the [documentation](https://docs.astral.sh/uv/concepts/cache/#caching-in-continuous-integration)
for more information.
By default, the uv cache is pruned after every run, removing pre-built wheels, but retaining any
wheels that were built from source. On GitHub-hosted runners, it's typically faster to omit those
pre-built wheels from the cache (and instead re-download them from the registry on each run).
However, on self-hosted or local runners, preserving the cache may be more efficient. See
the [documentation](https://docs.astral.sh/uv/concepts/cache/#caching-in-continuous-integration) for
more information.
If you want to prune the cache before saving it, enable cache pruning with the `prune-cache` input.
If you want to persist the entire cache across runs, disable cache pruning with the `prune-cache`
input.
```yaml
- name: Prune the cache before saving it
- name: Don't prune the cache before saving it
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
prune-cache: true
prune-cache: false
```
## Cache Python installs
By default, the Python install dir (`uv python dir` / `UV_PYTHON_INSTALL_DIR`) is not cached,
for the same reason that pruning the dependency cache can improve performance on GitHub-hosted
runners.
for the same reason that the dependency cache is pruned.
If you want to cache Python installs along with your dependencies, set the `cache-python` input to `true`.
Note that this only caches Python versions that uv actually installs into `UV_PYTHON_INSTALL_DIR`

27
package-lock.json generated
View File

@@ -27,7 +27,7 @@
"@vercel/ncc": "^0.44.1",
"esbuild": "^0.28.0",
"jest": "^30.4.2",
"js-yaml": "^4.1.1",
"js-yaml": "^5.2.1",
"ts-jest": "^29.4.11",
"typescript": "^6.0.3"
}
@@ -4365,16 +4365,25 @@
"license": "MIT"
},
"node_modules/js-yaml": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.1.tgz",
"integrity": "sha512-zfLtNfQqxVqq3uaTqSkh4x4hZw3KHobGUA0fJUj4wawW8bsQLTVqpHdXSIzidh7o+4lEW36tANuAGdaFx6Zgnw==",
"dev": true,
"license": "MIT",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/puzrin"
},
{
"type": "github",
"url": "https://github.com/sponsors/nodeca"
}
],
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
"js-yaml": "bin/js-yaml.mjs"
}
},
"node_modules/jsesc": {
@@ -8617,9 +8626,9 @@
"dev": true
},
"js-yaml": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.1.tgz",
"integrity": "sha512-zfLtNfQqxVqq3uaTqSkh4x4hZw3KHobGUA0fJUj4wawW8bsQLTVqpHdXSIzidh7o+4lEW36tANuAGdaFx6Zgnw==",
"dev": true,
"requires": {
"argparse": "^2.0.1"

View File

@@ -46,7 +46,7 @@
"@vercel/ncc": "^0.44.1",
"esbuild": "^0.28.0",
"jest": "^30.4.2",
"js-yaml": "^4.1.1",
"js-yaml": "^5.2.1",
"ts-jest": "^29.4.11",
"typescript": "^6.0.3"
}