mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-11-19 23:45:59 +00:00
Compare commits
No files matched your search
@@ -47,7 +47,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
|
||||
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
source-root: src
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
|
||||
uses: github/codeql-action/autobuild@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -73,4 +73,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
|
||||
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: 🚀 Run Release Drafter
|
||||
uses: release-drafter/release-drafter@34d80673e067bdc0c24568d3af899c216adcfaa9 # v7.7.0
|
||||
uses: release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7.10.0
|
||||
with:
|
||||
commitish: ${{ github.sha }}
|
||||
env:
|
||||
|
||||
+51
-23
@@ -27,18 +27,20 @@ jobs:
|
||||
- name: Actionlint
|
||||
uses: eifinger/actionlint-action@1fc89649be682d16ec5cf65ea16e269eb88d3982 # v1.10.2
|
||||
- name: Run zizmor
|
||||
uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
uses: zizmorcore/zizmor-action@85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e # v0.7.1
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
- run: |
|
||||
npm ci --ignore-scripts
|
||||
- name: Verify npm package signatures
|
||||
run: npm audit signatures
|
||||
- run: |
|
||||
npm run all
|
||||
- name: Check all jobs are in all-tests-passed.needs
|
||||
run: |
|
||||
tsc -p tsconfig.json
|
||||
npx --no-install tsc -p tsconfig.json
|
||||
node check-all-tests-passed-needs.js
|
||||
working-directory: .github/scripts
|
||||
- name: Make sure no changes from linters are detected
|
||||
@@ -49,8 +51,10 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
|
||||
os: [ubuntu-latest, macos-latest, macos-15, windows-latest]
|
||||
steps:
|
||||
- if: runner.os == 'macOS'
|
||||
uses: astral-sh/github-actions/demudhra@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
@@ -132,6 +136,7 @@ jobs:
|
||||
id: setup-uv
|
||||
uses: $/
|
||||
with:
|
||||
enable-cache: false
|
||||
version: ${{ matrix.input.version-input }}
|
||||
resolution-strategy: ${{ matrix.input.resolution-strategy || 'highest' }}
|
||||
- name: Correct version gets installed
|
||||
@@ -223,6 +228,7 @@ jobs:
|
||||
- name: Install version from ${{ matrix.input.version-file }}
|
||||
uses: $/
|
||||
with:
|
||||
enable-cache: false
|
||||
version-file: ${{ matrix.input.version-file }}
|
||||
- name: Correct version gets installed
|
||||
run: |
|
||||
@@ -241,6 +247,7 @@ jobs:
|
||||
id: setup-uv
|
||||
uses: $/
|
||||
with:
|
||||
enable-cache: false
|
||||
version-file: "__tests__/fixtures/.tool-versions"
|
||||
- name: Verify Python version from .tool-versions
|
||||
run: |
|
||||
@@ -279,6 +286,8 @@ jobs:
|
||||
- os: macos-latest
|
||||
checksum: "a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218"
|
||||
steps:
|
||||
- if: runner.os == 'macOS'
|
||||
uses: astral-sh/github-actions/demudhra@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
@@ -314,8 +323,10 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
|
||||
os: [ubuntu-latest, macos-latest, macos-15, windows-latest]
|
||||
steps:
|
||||
- if: runner.os == 'macOS'
|
||||
uses: astral-sh/github-actions/demudhra@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
||||
- name: Install default version
|
||||
uses: $/
|
||||
- run: uv tool install ruff==0.14.10
|
||||
@@ -327,6 +338,8 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
steps:
|
||||
- if: runner.os == 'macOS'
|
||||
uses: astral-sh/github-actions/demudhra@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
@@ -364,6 +377,8 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
steps:
|
||||
- if: runner.os == 'macOS'
|
||||
uses: astral-sh/github-actions/demudhra@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
||||
- name: Install latest version
|
||||
id: setup-uv
|
||||
uses: $/
|
||||
@@ -400,6 +415,8 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
steps:
|
||||
- if: runner.os == 'macOS'
|
||||
uses: astral-sh/github-actions/demudhra@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
||||
- name: Install latest version
|
||||
id: setup-uv
|
||||
uses: $/
|
||||
@@ -542,8 +559,6 @@ jobs:
|
||||
expected-os: "ubuntu-22.04"
|
||||
- os: ubuntu-24.04
|
||||
expected-os: "ubuntu-24.04"
|
||||
- os: macos-14
|
||||
expected-os: "macos-14"
|
||||
- os: macos-15
|
||||
expected-os: "macos-15"
|
||||
- os: windows-2022
|
||||
@@ -551,6 +566,8 @@ jobs:
|
||||
- os: windows-2025
|
||||
expected-os: "windows-2025"
|
||||
steps:
|
||||
- if: runner.os == 'macOS'
|
||||
uses: astral-sh/github-actions/demudhra@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
||||
- name: Setup uv
|
||||
id: setup-uv
|
||||
uses: $/
|
||||
@@ -985,14 +1002,18 @@ jobs:
|
||||
run: rm -rf "$UV_PYTHON_INSTALL_DIR"
|
||||
|
||||
test-cache-python-installs:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-2022]
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Verify Python install dir is not populated
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -d /home/runner/work/_temp/uv-python-dir ]; then
|
||||
if [ -e "$RUNNER_TEMP/uv-python-dir" ]; then
|
||||
echo "Python install dir should not exist"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1005,21 +1026,26 @@ jobs:
|
||||
- run: uv sync --managed-python
|
||||
working-directory: __tests__/fixtures/uv-project
|
||||
- name: Verify Python install dir exists
|
||||
shell: bash
|
||||
run: |
|
||||
if [ ! -d /home/runner/work/_temp/uv-python-dir ]; then
|
||||
if [ ! -d "$UV_PYTHON_INSTALL_DIR" ]; then
|
||||
echo "Python install dir should exist"
|
||||
exit 1
|
||||
fi
|
||||
test-restore-python-installs:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: test-cache-python-installs
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-2022]
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Verify Python install dir does not exist
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -d /home/runner/work/_temp/uv-python-dir ]; then
|
||||
if [ -e "$RUNNER_TEMP/uv-python-dir" ]; then
|
||||
echo "Python install dir should not exist"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1030,19 +1056,21 @@ jobs:
|
||||
enable-cache: true
|
||||
cache-python: true
|
||||
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-python-installs
|
||||
- name: Verify Python install dir exists
|
||||
run: |
|
||||
if [ ! -d /home/runner/work/_temp/uv-python-dir ]; then
|
||||
echo "Python install dir should exist"
|
||||
exit 1
|
||||
fi
|
||||
- name: Cache was hit
|
||||
run: |
|
||||
if [ "$CACHE_HIT" != "true" ]; then
|
||||
exit 1
|
||||
fi
|
||||
- name: Verify the restored Python minor-version link resolves to the patch directory
|
||||
shell: python
|
||||
env:
|
||||
CACHE_HIT: ${{ steps.restore.outputs.python-cache-hit }}
|
||||
run: |
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
assert os.environ["CACHE_HIT"] == "true", "expected a Python cache hit"
|
||||
installs = Path(os.environ["UV_PYTHON_INSTALL_DIR"]).resolve()
|
||||
assert installs.is_dir(), "Python install dir should exist"
|
||||
patch_dir, = installs.glob("cpython-*.*.*-*")
|
||||
minor_prefix = patch_dir.name.rsplit(".", 1)[0]
|
||||
alias, = installs.glob(f"{minor_prefix}-*")
|
||||
assert alias.resolve(strict=True) == patch_dir, alias
|
||||
- run: uv sync --managed-python
|
||||
working-directory: __tests__/fixtures/uv-project
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: true
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
@@ -38,7 +38,10 @@ jobs:
|
||||
fi
|
||||
- name: Compile changes
|
||||
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
|
||||
run: npm ci --ignore-scripts && npm run all
|
||||
run: |
|
||||
npm ci --ignore-scripts
|
||||
npm audit signatures
|
||||
npm run all
|
||||
- name: Create Pull Request
|
||||
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
|
||||
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
||||
|
||||
@@ -6,7 +6,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
|
||||
- Cache the installed version of uv to speed up consecutive runs on self-hosted runners
|
||||
- Register problem matchers for error output
|
||||
- (Optional) Persist the uv's cache in the GitHub Actions Cache
|
||||
- (Optional) Verify the checksum of the downloaded uv executable
|
||||
- Verify the SHA-256 checksum of the downloaded uv archive
|
||||
|
||||
## Contents
|
||||
|
||||
@@ -15,6 +15,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
|
||||
- [Inputs](#inputs)
|
||||
- [Outputs](#outputs)
|
||||
- [Python version](#python-version)
|
||||
- [Python architecture](#python-architecture)
|
||||
- [Working directory](#working-directory)
|
||||
- [Advanced Configuration](#advanced-configuration)
|
||||
- [How it works](#how-it-works)
|
||||
@@ -26,7 +27,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
```
|
||||
|
||||
If you do not specify a version, this action will look for a [required-version](https://docs.astral.sh/uv/reference/settings/#required-version)
|
||||
@@ -42,7 +43,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
|
||||
|
||||
```yaml
|
||||
- name: Install uv with all available options
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
# The version of uv to install, e.g., "0.5.0", "latest", or "latest-known" (default: searches for version in config files, then latest)
|
||||
version: ""
|
||||
@@ -56,6 +57,9 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
|
||||
# The version of Python to set UV_PYTHON to (overrides the Python version from .tool-versions)
|
||||
python-version: ""
|
||||
|
||||
# The Python architecture to set UV_PYTHON_ARCH to, e.g., x86_64 or aarch64
|
||||
python-arch: ""
|
||||
|
||||
# Use uv venv to activate a venv ready to be used by later steps
|
||||
activate-environment: "false"
|
||||
|
||||
@@ -71,13 +75,16 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
|
||||
# The checksum of the uv version to install
|
||||
checksum: ""
|
||||
|
||||
# Require a checksum bundled with setup-uv or supplied through the checksum input
|
||||
require-checksums: "false"
|
||||
|
||||
# Used when downloading uv from GitHub releases
|
||||
github-token: ${{ github.token }}
|
||||
|
||||
# Enable the GitHub Actions cache for uv: true, false, or auto (enabled on GitHub-hosted runners except for release, tag push, pull_request_target, and workflow_run events; disabled on self-hosted runners)
|
||||
enable-cache: "auto"
|
||||
|
||||
# Glob pattern to match files relative to the repository root to control the cache
|
||||
# Glob pattern to match files relative to the working directory to control the cache
|
||||
cache-dependency-glob: |
|
||||
**/*requirements*.txt
|
||||
**/*requirements*.in
|
||||
@@ -90,8 +97,8 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
|
||||
# Whether to restore the cache if found
|
||||
restore-cache: "true"
|
||||
|
||||
# Whether to save the cache after the run
|
||||
save-cache: "true"
|
||||
# Whether to save the cache after the run: true, false, or auto (disabled for merge_group events)
|
||||
save-cache: "auto"
|
||||
|
||||
# Suffix for the cache key
|
||||
cache-suffix: ""
|
||||
@@ -139,7 +146,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
|
||||
- `venv`: Path to the activated venv if activate-environment is true.
|
||||
- `python-version`: The Python version that was set.
|
||||
- `python-runtime-id`: An opaque identifier reported by uv for the activated venv's Python runtime. Empty when `activate-environment` is false.
|
||||
- `python-cache-hit`: A boolean value to indicate the Python cache entry was found.
|
||||
- `python-cache-hit`: A boolean indicating whether the Python cache was restored successfully.
|
||||
|
||||
### Python version
|
||||
|
||||
@@ -157,7 +164,7 @@ python 3.13
|
||||
```
|
||||
|
||||
```yaml
|
||||
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version-file: ".tool-versions"
|
||||
```
|
||||
@@ -168,7 +175,7 @@ a warning.
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv and set the python version to 3.13t
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
python-version: 3.13t
|
||||
- run: uv pip install --python=3.13t pip
|
||||
@@ -186,13 +193,32 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Install the latest version of uv and set the python version
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Test with python ${{ matrix.python-version }}
|
||||
run: uv run --frozen pytest
|
||||
```
|
||||
|
||||
### Python architecture
|
||||
|
||||
Use `python-arch` to set `UV_PYTHON_ARCH` for the rest of the job. This selects the Python
|
||||
architecture independently of the version, including versions requested by `.python-version`.
|
||||
An explicit architecture or interpreter path in a Python request takes precedence.
|
||||
|
||||
```yaml
|
||||
- uses: astral-sh/setup-uv@main
|
||||
with:
|
||||
python-version: "3.14"
|
||||
python-arch: x86_64
|
||||
- run: uv run --frozen pytest
|
||||
```
|
||||
|
||||
The input overrides an existing `UV_PYTHON_ARCH` value. When it is omitted, the action respects
|
||||
`UV_PYTHON_ARCH` from the environment. Both forms require a uv version that supports the variable;
|
||||
the action reports an error if the installed version does not support it. The selected architecture
|
||||
is included in the [cache key](docs/caching.md#cache-key).
|
||||
|
||||
### Working directory
|
||||
|
||||
You can set the working directory with the `working-directory` input.
|
||||
@@ -203,7 +229,7 @@ It also controls where [the venv gets created](#activate-environment), unless `v
|
||||
|
||||
```yaml
|
||||
- name: Install uv based on the config files in the working-directory
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
working-directory: my/subproject/dir
|
||||
```
|
||||
@@ -245,7 +271,7 @@ For example:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@main
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
- name: Test
|
||||
@@ -257,7 +283,7 @@ To install a specific version of Python, use
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
- name: Install Python 3.12
|
||||
@@ -276,7 +302,7 @@ output:
|
||||
uses: actions/checkout@main
|
||||
- name: Install the default version of uv
|
||||
id: setup-uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
- name: Print the installed version
|
||||
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
|
||||
```
|
||||
|
||||
+81
-3
@@ -1,9 +1,13 @@
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { beforeEach, describe, expect, it, jest } from "@jest/globals";
|
||||
import { createSetupInputs } from "../helpers/setup-inputs";
|
||||
|
||||
const mockRestoreCache = jest.fn();
|
||||
const mockSaveState = jest.fn();
|
||||
const mockSetOutput = jest.fn();
|
||||
const mockGetArch = jest.fn(() => "x86_64");
|
||||
const mockGetOSNameVersion = jest.fn(() => "ubuntu-24.04");
|
||||
const mockGetPlatform = jest.fn(async () => "unknown-linux-gnu");
|
||||
|
||||
jest.unstable_mockModule("@actions/cache", () => ({
|
||||
restoreCache: mockRestoreCache,
|
||||
@@ -24,9 +28,9 @@ jest.unstable_mockModule("../../src/utils/logging", () => ({
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule("../../src/utils/platforms", () => ({
|
||||
getArch: jest.fn(() => "x86_64"),
|
||||
getOSNameVersion: jest.fn(() => "ubuntu-24.04"),
|
||||
getPlatform: jest.fn(async () => "unknown-linux-gnu"),
|
||||
getArch: mockGetArch,
|
||||
getOSNameVersion: mockGetOSNameVersion,
|
||||
getPlatform: mockGetPlatform,
|
||||
}));
|
||||
|
||||
const { restoreCache } = await import("../../src/cache/restore-cache");
|
||||
@@ -39,9 +43,48 @@ function cacheKeyOutput(): string {
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
mockGetArch.mockReturnValue("x86_64");
|
||||
mockGetOSNameVersion.mockReturnValue("ubuntu-24.04");
|
||||
mockGetPlatform.mockResolvedValue("unknown-linux-gnu");
|
||||
});
|
||||
|
||||
describe("restoreCache", () => {
|
||||
it.each([
|
||||
["win32", false],
|
||||
["linux", true],
|
||||
] as const)(
|
||||
"keeps the matched Python cache key on %s when the install directory cannot be read",
|
||||
async (platform, pythonCacheHit) => {
|
||||
const inputs = createSetupInputs({
|
||||
cachePython: true,
|
||||
// A file at the install directory path makes readdir fail.
|
||||
pythonDir: fileURLToPath(import.meta.url),
|
||||
restoreCache: true,
|
||||
});
|
||||
mockRestoreCache
|
||||
.mockReturnValueOnce("uv-key")
|
||||
.mockReturnValueOnce("python-key");
|
||||
|
||||
const originalPlatform = process.platform;
|
||||
Object.defineProperty(process, "platform", { value: platform });
|
||||
try {
|
||||
await restoreCache(inputs);
|
||||
} finally {
|
||||
Object.defineProperty(process, "platform", { value: originalPlatform });
|
||||
}
|
||||
|
||||
expect(mockSetOutput).toHaveBeenCalledWith("cache-hit", true);
|
||||
expect(mockSetOutput).toHaveBeenCalledWith(
|
||||
"python-cache-hit",
|
||||
pythonCacheHit,
|
||||
);
|
||||
expect(mockSaveState).toHaveBeenCalledWith(
|
||||
"python-cache-matched-key",
|
||||
"python-key",
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it("encodes Python version ranges before adding them to the cache key", async () => {
|
||||
await restoreCache(createSetupInputs(), ">3.10.11,<3.11");
|
||||
|
||||
@@ -71,4 +114,39 @@ describe("restoreCache", () => {
|
||||
"setup-uv-2-x86_64-unknown-linux-gnu-ubuntu-24.04-3.11-dependencyhash-tests-3.11",
|
||||
);
|
||||
});
|
||||
|
||||
it("includes the resolved Python architecture in the cache key", async () => {
|
||||
const inputs = createSetupInputs({ pythonArch: "aarch64" });
|
||||
|
||||
await restoreCache(inputs, "3.14");
|
||||
|
||||
expect(cacheKeyOutput()).toContain("-3.14-python-aarch64-");
|
||||
});
|
||||
|
||||
it.each(["aarch64", "x86_64"])(
|
||||
"separates %s Python caches on a Windows ARM64 runner",
|
||||
async (pythonArch) => {
|
||||
mockGetArch.mockReturnValue("aarch64");
|
||||
mockGetOSNameVersion.mockReturnValue("windows-11");
|
||||
mockGetPlatform.mockResolvedValue("pc-windows-msvc");
|
||||
const inputs = createSetupInputs({
|
||||
cachePython: true,
|
||||
pythonArch,
|
||||
restoreCache: true,
|
||||
});
|
||||
|
||||
await restoreCache(inputs, "3.14");
|
||||
|
||||
const cacheKey = `setup-uv-2-aarch64-pc-windows-msvc-windows-11-3.14-python-${pythonArch}-py-dependencyhash`;
|
||||
expect(cacheKeyOutput()).toBe(cacheKey);
|
||||
expect(mockRestoreCache).toHaveBeenCalledWith(
|
||||
[inputs.cacheLocalPath?.path],
|
||||
cacheKey,
|
||||
);
|
||||
expect(mockRestoreCache).toHaveBeenCalledWith(
|
||||
[inputs.pythonDir],
|
||||
`${cacheKey}-python`,
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { runInNewContext } from "node:vm";
|
||||
import { expect, it } from "@jest/globals";
|
||||
|
||||
const saveCacheBundle = readFileSync(
|
||||
new URL("../../dist/save-cache/index.cjs", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
function bundledErrorClass(name: string): new (message: string) => Error {
|
||||
const start = saveCacheBundle.indexOf(`var ${name} = class`);
|
||||
expect(start).toBeGreaterThanOrEqual(0);
|
||||
|
||||
const end = saveCacheBundle.indexOf("\n};", start);
|
||||
expect(end).toBeGreaterThan(start);
|
||||
|
||||
const declaration = saveCacheBundle.slice(start, end + 3);
|
||||
return runInNewContext(`${declaration}; ${name}`, {
|
||||
__name: (target: object, value: string) =>
|
||||
Object.defineProperty(target, "name", { configurable: true, value }),
|
||||
}) as new (
|
||||
message: string,
|
||||
) => Error;
|
||||
}
|
||||
|
||||
it.each(["ValidationError", "ReserveCacheError", "FinalizeCacheError"])(
|
||||
"preserves the %s name in the save-cache bundle",
|
||||
(name) => {
|
||||
const ErrorClass = bundledErrorClass(name);
|
||||
|
||||
expect(new ErrorClass("test").name).toBe(ErrorClass.name);
|
||||
},
|
||||
);
|
||||
Vendored
+87
@@ -0,0 +1,87 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import {
|
||||
afterAll,
|
||||
beforeEach,
|
||||
describe,
|
||||
expect,
|
||||
it,
|
||||
jest,
|
||||
} from "@jest/globals";
|
||||
import { CacheLocalSource, type SetupInputs } from "../../src/utils/inputs";
|
||||
import { createSetupInputs } from "../helpers/setup-inputs";
|
||||
|
||||
const mockSaveCache = jest.fn<() => Promise<number>>();
|
||||
const mockInfo = jest.fn();
|
||||
const mockLoadInputs = jest.fn<() => SetupInputs>(() =>
|
||||
createSetupInputs({ enableCache: false }),
|
||||
);
|
||||
const state: Record<string, string> = {};
|
||||
|
||||
jest.unstable_mockModule("@actions/cache", () => ({
|
||||
saveCache: mockSaveCache,
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule("@actions/core", () => ({
|
||||
getState: jest.fn((name: string) => state[name] ?? ""),
|
||||
setFailed: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule("../../src/utils/inputs", () => ({
|
||||
loadInputs: mockLoadInputs,
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule("../../src/utils/logging", () => ({
|
||||
info: mockInfo,
|
||||
warning: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.spyOn(process, "exit").mockImplementation((() => undefined) as never);
|
||||
|
||||
const { run } = await import("../../src/save-cache");
|
||||
|
||||
const cacheDir = mkdtempSync(join(tmpdir(), "setup-uv-save-cache-"));
|
||||
const cacheKey = "setup-uv-2-x86_64-unknown-linux-gnu-ubuntu-24.04-3.12-hash";
|
||||
|
||||
function infoMessages(): string[] {
|
||||
return mockInfo.mock.calls.map(([msg]) => msg as string);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
delete process.env.UV_CACHE_DIR;
|
||||
state["cache-key"] = cacheKey;
|
||||
state["cache-matched-key"] = "";
|
||||
mockLoadInputs.mockReturnValue(
|
||||
createSetupInputs({
|
||||
cacheLocalPath: { path: cacheDir, source: CacheLocalSource.Input },
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
rmSync(cacheDir, { force: true, recursive: true });
|
||||
});
|
||||
|
||||
describe("saveCache", () => {
|
||||
it("reports the saved key when the cache is saved", async () => {
|
||||
mockSaveCache.mockResolvedValue(42);
|
||||
|
||||
await run();
|
||||
|
||||
expect(mockSaveCache).toHaveBeenCalledWith([cacheDir], cacheKey);
|
||||
expect(infoMessages()).toContain(`uv cache saved with key: ${cacheKey}`);
|
||||
});
|
||||
|
||||
it("does not report the cache as saved when saving fails", async () => {
|
||||
// @actions/cache logs the failure itself and returns -1
|
||||
mockSaveCache.mockResolvedValue(-1);
|
||||
|
||||
await run();
|
||||
|
||||
expect(mockSaveCache).toHaveBeenCalledWith([cacheDir], cacheKey);
|
||||
expect(infoMessages()).not.toContain(
|
||||
`uv cache saved with key: ${cacheKey}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -56,7 +56,7 @@ test("manifest checksums are used when no known checksum exists", async () => {
|
||||
).rejects.toThrow("did not match");
|
||||
});
|
||||
|
||||
test("empty manifest checksums are rejected", async () => {
|
||||
test.each(["", undefined])("rejects missing checksums (%s)", async (hash) => {
|
||||
await expect(
|
||||
validateChecksum(
|
||||
undefined,
|
||||
@@ -64,7 +64,7 @@ test("empty manifest checksums are rejected", async () => {
|
||||
"aarch64",
|
||||
"pc-windows-msvc",
|
||||
"1.2.3",
|
||||
"",
|
||||
hash,
|
||||
),
|
||||
).rejects.toThrow("No checksum found");
|
||||
});
|
||||
|
||||
@@ -146,6 +146,55 @@ describe("download-version", () => {
|
||||
expect(mockGetAllVersions).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("resolves ~= with PEP 440 compatible release semantics", async () => {
|
||||
mockGetFirstMatchingVersion.mockImplementation(
|
||||
(predicate: (version: string) => boolean) =>
|
||||
["1.0.0", "0.10.2", "0.9.26"].find(predicate),
|
||||
);
|
||||
|
||||
const version = await resolveVersion("~=0.9", undefined);
|
||||
|
||||
expect(version).toBe("0.10.2");
|
||||
});
|
||||
|
||||
it("resolves ~= with PEP 440 compatible release semantics from manifest-file", async () => {
|
||||
mockGetAllVersions.mockResolvedValue(["1.0.0", "0.10.2", "0.9.26"]);
|
||||
|
||||
const version = await resolveVersion(
|
||||
"~=0.9",
|
||||
"https://example.com/custom.ndjson",
|
||||
);
|
||||
|
||||
expect(version).toBe("0.10.2");
|
||||
});
|
||||
|
||||
it.each([
|
||||
["<=0.9", "0.9.0"],
|
||||
["==0.9", "0.9.0"],
|
||||
])("resolves %s with PEP 440 semantics", async (specifier, expected) => {
|
||||
mockGetFirstMatchingVersion.mockImplementation(
|
||||
(predicate: (version: string) => boolean) =>
|
||||
["0.10.2", "0.9.26", "0.9.0", "0.8.24"].find(predicate),
|
||||
);
|
||||
|
||||
const version = await resolveVersion(specifier, undefined);
|
||||
|
||||
expect(version).toBe(expected);
|
||||
});
|
||||
|
||||
it("resolves >0.9 with PEP 440 semantics for the lowest strategy", async () => {
|
||||
mockGetAllVersions.mockResolvedValue([
|
||||
"0.10.0",
|
||||
"0.9.26",
|
||||
"0.9.1",
|
||||
"0.9.0",
|
||||
]);
|
||||
|
||||
const version = await resolveVersion(">0.9", undefined, "lowest");
|
||||
|
||||
expect(version).toBe("0.9.1");
|
||||
});
|
||||
|
||||
it("treats == exact pins as explicit versions", async () => {
|
||||
const version = await resolveVersion("==0.9.26", undefined);
|
||||
|
||||
@@ -220,7 +269,7 @@ describe("download-version", () => {
|
||||
"token",
|
||||
),
|
||||
).rejects.toThrow(
|
||||
"Could not find artifact for version 0.9.26, arch x86_64, platform unknown-linux-gnu in https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson .",
|
||||
"Could not find artifact for version 0.9.26, arch x86_64, platform unknown-linux-gnu in https://releases.astral.sh/github/versions/main/v1/uv.ndjson .",
|
||||
);
|
||||
|
||||
expect(mockDownloadTool).not.toHaveBeenCalled();
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
import { execFile, execFileSync } from "node:child_process";
|
||||
import { createHash } from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import { createServer } from "node:http";
|
||||
import type { AddressInfo } from "node:net";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { promisify } from "node:util";
|
||||
import { expect, test } from "@jest/globals";
|
||||
import { getArch, getPlatform } from "../../src/utils/platforms";
|
||||
|
||||
test("enforces intrinsic checksums on downloads and tool-cache hits", async () => {
|
||||
const platform = await getPlatform();
|
||||
const target = `${getArch()}-${platform}`;
|
||||
const windows = platform === "pc-windows-msvc";
|
||||
const dir = fs.mkdtempSync(path.join(tmpdir(), "setup-uv-checksums-"));
|
||||
const server = createServer();
|
||||
try {
|
||||
const member = windows ? "uv.exe" : `uv-${target}/uv`;
|
||||
const archiveName = windows ? "uv.zip" : "uv.tar.gz";
|
||||
fs.mkdirSync(path.dirname(path.join(dir, member)), { recursive: true });
|
||||
fs.writeFileSync(path.join(dir, member), "test build");
|
||||
execFileSync("tar", ["-acf", archiveName, member], { cwd: dir });
|
||||
const archive = fs.readFileSync(path.join(dir, archiveName));
|
||||
const digest = createHash("sha256").update(archive).digest("hex");
|
||||
let downloads = 0;
|
||||
server.on("request", (_req, res) => {
|
||||
downloads++;
|
||||
res.end(archive);
|
||||
});
|
||||
await new Promise<void>((resolve) =>
|
||||
server.listen(0, "127.0.0.1", resolve),
|
||||
);
|
||||
const address = server.address() as AddressInfo;
|
||||
|
||||
function install(version: string, strict: boolean, checksum = "") {
|
||||
const manifest = JSON.stringify({
|
||||
artifacts: [
|
||||
{
|
||||
archive_format: windows ? "zip" : "tar.gz",
|
||||
platform: target,
|
||||
sha256: digest,
|
||||
url: `http://127.0.0.1:${address.port}/${archiveName}`,
|
||||
},
|
||||
],
|
||||
version,
|
||||
});
|
||||
return promisify(execFile)(process.execPath, ["dist/setup/index.cjs"], {
|
||||
env: {
|
||||
"INPUT_ACTIVATE-ENVIRONMENT": "false",
|
||||
INPUT_CHECKSUM: checksum,
|
||||
"INPUT_MANIFEST-FILE": `data:application/json,${encodeURIComponent(manifest)}`,
|
||||
"INPUT_NO-PROJECT": "false",
|
||||
"INPUT_PYTHON-VERSION": "3.13",
|
||||
"INPUT_REQUIRE-CHECKSUMS": String(strict),
|
||||
INPUT_VERSION: version,
|
||||
"INPUT_WORKING-DIRECTORY": dir,
|
||||
PATH: process.env.PATH,
|
||||
RUNNER_TEMP: dir,
|
||||
RUNNER_TOOL_CACHE: path.join(dir, "cache"),
|
||||
SystemRoot: process.env.SystemRoot,
|
||||
},
|
||||
timeout: 10_000,
|
||||
});
|
||||
}
|
||||
|
||||
const version = "99.0.0";
|
||||
await install(version, false);
|
||||
await expect(install(version, true)).rejects.toMatchObject({
|
||||
stdout: expect.stringContaining(
|
||||
`No bundled checksum for ${target}-${version}`,
|
||||
),
|
||||
});
|
||||
expect(downloads).toBe(1);
|
||||
await install(version, true, digest);
|
||||
expect(downloads).toBe(2);
|
||||
await install(version, true, digest);
|
||||
expect(downloads).toBe(2);
|
||||
await expect(install(version, true, "0".repeat(64))).rejects.toMatchObject({
|
||||
stdout: expect.stringContaining("did not match"),
|
||||
});
|
||||
// The custom manifest also offers these bytes under a known release version.
|
||||
await expect(install("0.9.26", true)).rejects.toMatchObject({
|
||||
stdout: expect.stringContaining("did not match"),
|
||||
});
|
||||
await expect(install(version, true, "../uv")).rejects.toMatchObject({
|
||||
stdout: expect.stringContaining("Expected a SHA-256 checksum"),
|
||||
});
|
||||
} finally {
|
||||
server.close();
|
||||
fs.rmSync(dir, { force: true, recursive: true });
|
||||
}
|
||||
}, 30_000);
|
||||
@@ -96,6 +96,78 @@ describe("manifest", () => {
|
||||
expect(versions).toHaveLength(2);
|
||||
expect(versions[0]?.version).toBe("0.9.26");
|
||||
expect(versions[1]?.version).toBe("0.9.25");
|
||||
expect(mockFetch.mock.calls.map(([url]) => url)).toEqual([
|
||||
"https://releases.astral.sh/github/versions/main/v1/uv.ndjson",
|
||||
]);
|
||||
});
|
||||
|
||||
it("falls back to GitHub after mirror network retries are exhausted", async () => {
|
||||
jest.useFakeTimers();
|
||||
mockFetch
|
||||
.mockRejectedValueOnce(new Error("mirror unavailable"))
|
||||
.mockRejectedValueOnce(new Error("mirror unavailable"))
|
||||
.mockRejectedValueOnce(new Error("mirror unavailable"))
|
||||
.mockResolvedValueOnce(
|
||||
createMockResponse(true, 200, "OK", sampleManifestResponse),
|
||||
);
|
||||
|
||||
const result = fetchManifest();
|
||||
await jest.runAllTimersAsync();
|
||||
|
||||
await expect(result).resolves.toEqual([
|
||||
expect.objectContaining({ version: "0.9.26" }),
|
||||
expect.objectContaining({ version: "0.9.25" }),
|
||||
]);
|
||||
expect(mockFetch.mock.calls.map(([url]) => url)).toEqual([
|
||||
"https://releases.astral.sh/github/versions/main/v1/uv.ndjson",
|
||||
"https://releases.astral.sh/github/versions/main/v1/uv.ndjson",
|
||||
"https://releases.astral.sh/github/versions/main/v1/uv.ndjson",
|
||||
"https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson",
|
||||
]);
|
||||
|
||||
await expect(getLatestVersion()).resolves.toBe("0.9.26");
|
||||
expect(mockFetch).toHaveBeenCalledTimes(4);
|
||||
});
|
||||
|
||||
it.each([404, 429, 503])(
|
||||
"falls back to a streaming GitHub manifest on mirror HTTP %s",
|
||||
async (status) => {
|
||||
mockFetch
|
||||
.mockResolvedValueOnce(createMockResponse(false, status, "Error", ""))
|
||||
.mockResolvedValueOnce(
|
||||
createStreamingMockResponse([`${sampleManifestResponse}\n`]),
|
||||
);
|
||||
|
||||
await expect(getLatestVersion()).resolves.toBe("0.9.26");
|
||||
await expect(
|
||||
getArtifact("0.9.26", "aarch64", "apple-darwin"),
|
||||
).resolves.toEqual({
|
||||
archiveFormat: "tar.gz",
|
||||
checksum:
|
||||
"fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f",
|
||||
downloadUrl:
|
||||
"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.tar.gz",
|
||||
});
|
||||
expect(mockFetch.mock.calls.map(([url]) => url)).toEqual([
|
||||
"https://releases.astral.sh/github/versions/main/v1/uv.ndjson",
|
||||
"https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson",
|
||||
]);
|
||||
},
|
||||
);
|
||||
|
||||
it("does not fall back from a custom manifest", async () => {
|
||||
mockFetch.mockResolvedValue(
|
||||
createMockResponse(false, 503, "Service Unavailable", ""),
|
||||
);
|
||||
|
||||
await expect(
|
||||
fetchManifest("https://example.com/custom.ndjson"),
|
||||
).rejects.toThrow(
|
||||
"Failed to fetch manifest data: 503 Service Unavailable",
|
||||
);
|
||||
expect(mockFetch.mock.calls.map(([url]) => url)).toEqual([
|
||||
"https://example.com/custom.ndjson",
|
||||
]);
|
||||
});
|
||||
|
||||
it("retries network failures", async () => {
|
||||
@@ -123,7 +195,7 @@ describe("manifest", () => {
|
||||
await jest.runAllTimersAsync();
|
||||
|
||||
await result;
|
||||
expect(mockFetch).toHaveBeenCalledTimes(MANIFEST_FETCH_ATTEMPTS);
|
||||
expect(mockFetch).toHaveBeenCalledTimes(MANIFEST_FETCH_ATTEMPTS * 2);
|
||||
});
|
||||
|
||||
it("throws on a failed fetch", async () => {
|
||||
|
||||
@@ -16,14 +16,17 @@ export function createSetupInputs(
|
||||
checksum: "",
|
||||
downloadFromAstralMirror: false,
|
||||
enableCache: true,
|
||||
exportPythonArch: false,
|
||||
githubToken: "",
|
||||
ignoreEmptyWorkdir: false,
|
||||
ignoreNothingToCache: false,
|
||||
noProject: false,
|
||||
pruneCache: false,
|
||||
pythonArch: "",
|
||||
pythonDir: "/tmp/uv-python-dir",
|
||||
pythonVersion: "",
|
||||
quiet: false,
|
||||
requireChecksums: false,
|
||||
resolutionStrategy: "highest",
|
||||
restoreCache: false,
|
||||
saveCache: true,
|
||||
|
||||
@@ -19,6 +19,7 @@ const ORIGINAL_RUNNER_ENVIRONMENT = process.env.RUNNER_ENVIRONMENT;
|
||||
const ORIGINAL_RUNNER_TEMP = process.env.RUNNER_TEMP;
|
||||
const ORIGINAL_UV_CACHE_DIR = process.env.UV_CACHE_DIR;
|
||||
const ORIGINAL_UV_PYTHON = process.env.UV_PYTHON;
|
||||
const ORIGINAL_UV_PYTHON_ARCH = process.env.UV_PYTHON_ARCH;
|
||||
const ORIGINAL_UV_PYTHON_INSTALL_DIR = process.env.UV_PYTHON_INSTALL_DIR;
|
||||
|
||||
const mockDebug = jest.fn();
|
||||
@@ -62,6 +63,7 @@ function resetEnvironment(): void {
|
||||
delete process.env.RUNNER_TEMP;
|
||||
delete process.env.UV_CACHE_DIR;
|
||||
delete process.env.UV_PYTHON;
|
||||
delete process.env.UV_PYTHON_ARCH;
|
||||
delete process.env.UV_PYTHON_INSTALL_DIR;
|
||||
}
|
||||
|
||||
@@ -77,6 +79,11 @@ function restoreEnvironment(): void {
|
||||
process.env.RUNNER_TEMP = ORIGINAL_RUNNER_TEMP;
|
||||
process.env.UV_CACHE_DIR = ORIGINAL_UV_CACHE_DIR;
|
||||
process.env.UV_PYTHON = ORIGINAL_UV_PYTHON;
|
||||
if (ORIGINAL_UV_PYTHON_ARCH === undefined) {
|
||||
delete process.env.UV_PYTHON_ARCH;
|
||||
} else {
|
||||
process.env.UV_PYTHON_ARCH = ORIGINAL_UV_PYTHON_ARCH;
|
||||
}
|
||||
process.env.UV_PYTHON_INSTALL_DIR = ORIGINAL_UV_PYTHON_INSTALL_DIR;
|
||||
}
|
||||
|
||||
@@ -98,11 +105,19 @@ describe("loadInputs", () => {
|
||||
source: CacheLocalSource.Default,
|
||||
});
|
||||
expect(inputs.pythonDir).toBe("/runner-temp/uv-python-dir");
|
||||
expect(inputs.pythonArch).toBe("");
|
||||
expect(inputs.exportPythonArch).toBe(false);
|
||||
expect(inputs.venvPath).toBe("/workspace/.venv");
|
||||
expect(inputs.manifestFile).toBeUndefined();
|
||||
expect(inputs.requireChecksums).toBe(false);
|
||||
expect(inputs.resolutionStrategy).toBe("highest");
|
||||
});
|
||||
|
||||
it("loads require-checksums", () => {
|
||||
mockInputs["require-checksums"] = "true";
|
||||
expect(loadInputs().requireChecksums).toBe(true);
|
||||
});
|
||||
|
||||
it("uses the Python version from an explicitly selected .tool-versions file", () => {
|
||||
mockInputs["working-directory"] = createTempProject({
|
||||
".tool-versions": "uv 0.12.3\npython 3.13.1t\n",
|
||||
@@ -149,6 +164,28 @@ describe("loadInputs", () => {
|
||||
expect(inputs.pythonVersion).toBe("");
|
||||
});
|
||||
|
||||
it("prefers the python-arch input over UV_PYTHON_ARCH", () => {
|
||||
mockInputs["working-directory"] = "/workspace";
|
||||
mockInputs["python-arch"] = "x86_64";
|
||||
process.env.UV_PYTHON_ARCH = "aarch64";
|
||||
|
||||
const inputs = loadInputs();
|
||||
expect(inputs.pythonArch).toBe("x86_64");
|
||||
expect(inputs.exportPythonArch).toBe(true);
|
||||
});
|
||||
|
||||
it.each(["aarch64", "x86_64_v3", ""])(
|
||||
"uses UV_PYTHON_ARCH when python-arch is omitted: %s",
|
||||
(pythonArch) => {
|
||||
mockInputs["working-directory"] = "/workspace";
|
||||
process.env.UV_PYTHON_ARCH = pythonArch;
|
||||
|
||||
const inputs = loadInputs();
|
||||
expect(inputs.pythonArch).toBe(pythonArch);
|
||||
expect(inputs.exportPythonArch).toBe(false);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(["pull_request_target", "workflow_run", "release"])(
|
||||
"disables automatic caching for the %s event",
|
||||
(eventName) => {
|
||||
@@ -206,6 +243,51 @@ describe("loadInputs", () => {
|
||||
expect(inputs.enableCache).toBe(true);
|
||||
});
|
||||
|
||||
it("restores but does not save cache automatically for merge groups", () => {
|
||||
mockInputs["working-directory"] = "/workspace";
|
||||
mockInputs["enable-cache"] = "auto";
|
||||
mockInputs["restore-cache"] = "true";
|
||||
mockInputs["save-cache"] = "auto";
|
||||
process.env.RUNNER_ENVIRONMENT = "github-hosted";
|
||||
process.env.RUNNER_TEMP = "/runner-temp";
|
||||
process.env.GITHUB_EVENT_NAME = "merge_group";
|
||||
|
||||
const inputs = loadInputs();
|
||||
|
||||
expect(inputs.enableCache).toBe(true);
|
||||
expect(inputs.restoreCache).toBe(true);
|
||||
expect(inputs.saveCache).toBe(false);
|
||||
expect(mockInfo).toHaveBeenCalledWith(
|
||||
"Cache saving is disabled for the merge_group event",
|
||||
);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["true", true],
|
||||
["false", false],
|
||||
])("honors save-cache %s for merge groups", (saveCacheInput, expected) => {
|
||||
mockInputs["working-directory"] = "/workspace";
|
||||
mockInputs["save-cache"] = saveCacheInput;
|
||||
process.env.GITHUB_EVENT_NAME = "merge_group";
|
||||
|
||||
const inputs = loadInputs();
|
||||
|
||||
expect(inputs.saveCache).toBe(expected);
|
||||
expect(mockInfo).not.toHaveBeenCalledWith(
|
||||
"Cache saving is disabled for the merge_group event",
|
||||
);
|
||||
});
|
||||
|
||||
it("automatically saves cache for other events", () => {
|
||||
mockInputs["working-directory"] = "/workspace";
|
||||
mockInputs["save-cache"] = "auto";
|
||||
process.env.GITHUB_EVENT_NAME = "push";
|
||||
|
||||
const inputs = loadInputs();
|
||||
|
||||
expect(inputs.saveCache).toBe(true);
|
||||
});
|
||||
|
||||
it("uses cache-dir from pyproject.toml when present", () => {
|
||||
mockInputs["working-directory"] = createTempProject({
|
||||
"pyproject.toml": `[project]
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
import { promisify } from "node:util";
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
describe,
|
||||
expect,
|
||||
it,
|
||||
jest,
|
||||
} from "@jest/globals";
|
||||
|
||||
const ORIGINAL_UV_PYTHON_ARCH = process.env.UV_PYTHON_ARCH;
|
||||
|
||||
const mockExecFile =
|
||||
jest.fn<
|
||||
(...args: unknown[]) => Promise<{
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}>
|
||||
>();
|
||||
const mockExportVariable = jest.fn();
|
||||
|
||||
jest.unstable_mockModule("node:child_process", () => ({
|
||||
execFile: Object.assign(mockExecFile, { [promisify.custom]: mockExecFile }),
|
||||
}));
|
||||
jest.unstable_mockModule("@actions/core", () => ({
|
||||
exportVariable: mockExportVariable,
|
||||
}));
|
||||
jest.unstable_mockModule("../../src/utils/logging", () => ({
|
||||
info: jest.fn(),
|
||||
}));
|
||||
|
||||
const { setupPythonArch } = await import("../../src/utils/python-arch");
|
||||
|
||||
const supportedProbe = Object.assign(new Error("uv exited with code 2"), {
|
||||
code: 2,
|
||||
stderr:
|
||||
"error: Failed to parse environment variable `UV_PYTHON_ARCH` with invalid value `setup-uv-probe`: Unknown architecture: setup-uv-probe\n",
|
||||
});
|
||||
const success = { stderr: "", stdout: "/cache\n" };
|
||||
|
||||
beforeEach(() => {
|
||||
delete process.env.UV_PYTHON_ARCH;
|
||||
jest.clearAllMocks();
|
||||
mockExecFile
|
||||
.mockReset()
|
||||
.mockRejectedValueOnce(supportedProbe)
|
||||
.mockResolvedValueOnce(success);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (ORIGINAL_UV_PYTHON_ARCH === undefined) {
|
||||
delete process.env.UV_PYTHON_ARCH;
|
||||
} else {
|
||||
process.env.UV_PYTHON_ARCH = ORIGINAL_UV_PYTHON_ARCH;
|
||||
}
|
||||
});
|
||||
|
||||
describe("setupPythonArch", () => {
|
||||
it("leaves Python selection alone without an architecture", async () => {
|
||||
await setupPythonArch("/tools/uv", "", false);
|
||||
|
||||
expect(mockExecFile).not.toHaveBeenCalled();
|
||||
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("validates a resolved environment architecture without exporting it", async () => {
|
||||
process.env.UV_PYTHON_ARCH = "aarch64";
|
||||
|
||||
await setupPythonArch("/tools/uv", "aarch64", false);
|
||||
|
||||
expect(mockExecFile).toHaveBeenNthCalledWith(
|
||||
2,
|
||||
"/tools/uv",
|
||||
["--no-config", "cache", "dir"],
|
||||
expect.objectContaining({
|
||||
env: expect.objectContaining({ UV_PYTHON_ARCH: "aarch64" }),
|
||||
}),
|
||||
);
|
||||
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||
expect(process.env.UV_PYTHON_ARCH).toBe("aarch64");
|
||||
});
|
||||
|
||||
it.each(["/runner temp/uv", "C:\\runner temp\\uv.exe"])(
|
||||
"validates and exports the architecture using the installed uv: %s",
|
||||
async (uvPath) => {
|
||||
await setupPythonArch(uvPath, "x86_64", true);
|
||||
|
||||
expect(mockExecFile).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
uvPath,
|
||||
["--no-config", "cache", "dir"],
|
||||
expect.objectContaining({
|
||||
encoding: "utf8",
|
||||
env: expect.objectContaining({ UV_PYTHON_ARCH: "setup-uv-probe" }),
|
||||
}),
|
||||
);
|
||||
expect(mockExecFile).toHaveBeenNthCalledWith(
|
||||
2,
|
||||
uvPath,
|
||||
["--no-config", "cache", "dir"],
|
||||
expect.objectContaining({
|
||||
env: expect.objectContaining({ UV_PYTHON_ARCH: "x86_64" }),
|
||||
}),
|
||||
);
|
||||
expect(mockExportVariable).toHaveBeenCalledWith(
|
||||
"UV_PYTHON_ARCH",
|
||||
"x86_64",
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it("rejects uv versions that ignore UV_PYTHON_ARCH", async () => {
|
||||
mockExecFile.mockReset().mockResolvedValue(success);
|
||||
|
||||
await expect(setupPythonArch("/tools/uv", "x86_64", true)).rejects.toThrow(
|
||||
"The installed version of uv does not support UV_PYTHON_ARCH",
|
||||
);
|
||||
expect(mockExecFile).toHaveBeenCalledTimes(1);
|
||||
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("reports unexpected probe failures", async () => {
|
||||
mockExecFile.mockReset().mockRejectedValue(
|
||||
Object.assign(new Error("uv exited with code 2"), {
|
||||
code: 2,
|
||||
stderr: "error: unrelated configuration error\n",
|
||||
}),
|
||||
);
|
||||
|
||||
await expect(setupPythonArch("/tools/uv", "x86_64", true)).rejects.toThrow(
|
||||
"Failed to check uv's support for UV_PYTHON_ARCH: error: unrelated configuration error",
|
||||
);
|
||||
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("reports invalid architectures before exporting them", async () => {
|
||||
mockExecFile
|
||||
.mockReset()
|
||||
.mockRejectedValueOnce(supportedProbe)
|
||||
.mockRejectedValueOnce(
|
||||
Object.assign(new Error("uv exited with code 2"), {
|
||||
code: 2,
|
||||
stderr: "error: Unknown architecture: invalid\n",
|
||||
}),
|
||||
);
|
||||
|
||||
await expect(setupPythonArch("/tools/uv", "invalid", true)).rejects.toThrow(
|
||||
"Failed to set Python architecture to invalid: error: Unknown architecture: invalid",
|
||||
);
|
||||
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -35,3 +35,14 @@ test("strips PEP 508 markers from requirements dependencies", () => {
|
||||
|
||||
expect(parsedVersion).toBe("==0.11.20");
|
||||
});
|
||||
|
||||
test.each([
|
||||
["uv >= 0.5.0", ">=0.5.0"],
|
||||
["uv == 0.11.20", "==0.11.20"],
|
||||
["uv>=0.5.0, <0.6.0", ">=0.5.0,<0.6.0"],
|
||||
["uv >= 0.5.0 , < 0.6.0", ">=0.5.0,<0.6.0"],
|
||||
["uv==0.11.20 --hash=sha256:abc", "==0.11.20"],
|
||||
["uv==0.11.20 # pinned for CI", "==0.11.20"],
|
||||
])("allows whitespace in the uv specifier %s", (dependency, expected) => {
|
||||
expect(getUvVersionFromRequirementsText(dependency)).toBe(expected);
|
||||
});
|
||||
+9
-1
@@ -7,6 +7,8 @@ inputs:
|
||||
type: string
|
||||
python-version:
|
||||
type: string
|
||||
python-arch:
|
||||
type: string
|
||||
activate-environment:
|
||||
type: boolean
|
||||
venv-path:
|
||||
@@ -17,6 +19,8 @@ inputs:
|
||||
type: string
|
||||
checksum:
|
||||
type: string
|
||||
require-checksums:
|
||||
type: boolean
|
||||
github-token:
|
||||
type: string
|
||||
enable-cache:
|
||||
@@ -33,7 +37,11 @@ inputs:
|
||||
restore-cache:
|
||||
type: boolean
|
||||
save-cache:
|
||||
type: boolean
|
||||
type: enum
|
||||
allowed-values:
|
||||
- "true"
|
||||
- "false"
|
||||
- auto
|
||||
cache-suffix:
|
||||
type: string
|
||||
cache-local-path:
|
||||
|
||||
+9
-3
@@ -12,6 +12,9 @@ inputs:
|
||||
python-version:
|
||||
description: "The version of Python to set UV_PYTHON to. Overrides the Python version from .tool-versions."
|
||||
required: false
|
||||
python-arch:
|
||||
description: "The Python architecture to set UV_PYTHON_ARCH to, e.g., x86_64 or aarch64. Overrides UV_PYTHON_ARCH."
|
||||
required: false
|
||||
activate-environment:
|
||||
description: "Use uv venv to activate a venv ready to be used by later steps. "
|
||||
default: "false"
|
||||
@@ -27,6 +30,9 @@ inputs:
|
||||
checksum:
|
||||
description: "The checksum of the uv version to install"
|
||||
required: false
|
||||
require-checksums:
|
||||
description: "Require a SHA-256 checksum bundled with setup-uv or supplied through the checksum input."
|
||||
default: "false"
|
||||
github-token:
|
||||
description:
|
||||
"Used when downloading uv from GitHub releases."
|
||||
@@ -51,8 +57,8 @@ inputs:
|
||||
description: "Whether to restore the cache if found."
|
||||
default: "true"
|
||||
save-cache:
|
||||
description: "Whether to save the cache after the run."
|
||||
default: "true"
|
||||
description: "Whether to save the cache after the run. 'auto' disables saving for merge_group events."
|
||||
default: "auto"
|
||||
cache-suffix:
|
||||
description: "Suffix for the cache key"
|
||||
required: false
|
||||
@@ -110,7 +116,7 @@ outputs:
|
||||
python-runtime-id:
|
||||
description: "An opaque identifier reported by uv for the activated venv's Python runtime. Empty when activate-environment is false."
|
||||
python-cache-hit:
|
||||
description: "A boolean value to indicate the Python cache entry was found"
|
||||
description: "A boolean indicating whether the Python cache was restored successfully."
|
||||
runs:
|
||||
using: "node24"
|
||||
main: "dist/setup/index.cjs"
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.5.8/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
|
||||
"assist": {
|
||||
"actions": {
|
||||
"source": {
|
||||
|
||||
+2822
-1027
File diff suppressed because it is too large.
Load diff
+2357
-1060
File diff suppressed because it is too large.
Load diff
+1874
-692
File diff suppressed because it is too large.
Load diff
@@ -6,7 +6,7 @@ This document covers advanced options for configuring which version of uv to ins
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: "latest"
|
||||
```
|
||||
@@ -15,11 +15,13 @@ This document covers advanced options for configuring which version of uv to ins
|
||||
|
||||
Use `latest-known` to install the newest uv version whose checksums were bundled with the version of setup-uv used by your workflow. Version resolution is performed locally without fetching the latest release, so updating setup-uv also updates the version selected by `latest-known`.
|
||||
|
||||
When `manifest-file` is set, `latest-known` still selects a version from setup-uv's bundled checksum table, but the artifact and checksum come from the custom manifest.
|
||||
When `manifest-file` is set, `latest-known` still selects a version from setup-uv's bundled checksum table.
|
||||
By default the custom manifest supplies the artifact and checksum. To require a bundled or explicitly
|
||||
supplied checksum, enable `require-checksums`. [Checksum validation](customization.md#validate-checksum)
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv known to setup-uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: "latest-known"
|
||||
```
|
||||
@@ -28,7 +30,7 @@ When `manifest-file` is set, `latest-known` still selects a version from setup-u
|
||||
|
||||
```yaml
|
||||
- name: Install a specific version of uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: "0.4.4"
|
||||
```
|
||||
@@ -41,21 +43,21 @@ to install the latest version that satisfies the range.
|
||||
|
||||
```yaml
|
||||
- name: Install a semver range of uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: ">=0.4.0"
|
||||
```
|
||||
|
||||
```yaml
|
||||
- name: Pinning a minor version of uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: "0.4.x"
|
||||
```
|
||||
|
||||
```yaml
|
||||
- name: Install a pep440-specifier-satisfying version of uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: ">=0.4.25,<0.5"
|
||||
```
|
||||
@@ -67,7 +69,7 @@ You can change this behavior using the `resolution-strategy` input:
|
||||
|
||||
```yaml
|
||||
- name: Install the lowest compatible version of uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: ">=0.4.0"
|
||||
resolution-strategy: "lowest"
|
||||
@@ -92,7 +94,7 @@ as `UV_PYTHON`. Only a single Python version is supported; multiple fallback ver
|
||||
|
||||
```yaml
|
||||
- name: Install uv based on the version defined in pyproject.toml
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version-file: "pyproject.toml"
|
||||
```
|
||||
@@ -103,7 +105,7 @@ silently picking up a newer uv until the lockfile is updated.
|
||||
|
||||
```yaml
|
||||
- name: Install uv based on the version locked in uv.lock
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version-file: "uv.lock"
|
||||
```
|
||||
+17
-14
@@ -11,6 +11,7 @@ The cache key is automatically generated based on:
|
||||
`pc-windows-msvc`)
|
||||
- **OS version**: OS name and version (e.g., `ubuntu-22.04`, `macos-14`, `windows-2022`)
|
||||
- **Python version**: The Python version in use
|
||||
- **Python architecture**: The architecture selected by `python-arch` or `UV_PYTHON_ARCH`, when set
|
||||
- **Cache options**: Whether pruning and Python caching are enabled
|
||||
- **Dependency hash**: Hash of files matching `cache-dependency-glob`
|
||||
- **Suffix**: Optional `cache-suffix` if provided
|
||||
@@ -23,7 +24,7 @@ The computed cache key is available as the `cache-key` output:
|
||||
```yaml
|
||||
- name: Setup uv
|
||||
id: setup-uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
- name: Print cache key
|
||||
@@ -53,7 +54,7 @@ You can optionally define a custom cache key suffix.
|
||||
```yaml
|
||||
- name: Enable caching and define a custom cache key suffix
|
||||
id: setup-uv
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-suffix: "optional-suffix"
|
||||
@@ -92,7 +93,7 @@ changes. If you use relative paths, they are relative to the working directory.
|
||||
|
||||
```yaml
|
||||
- name: Define a cache dependency glob
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "**/pyproject.toml"
|
||||
@@ -100,7 +101,7 @@ changes. If you use relative paths, they are relative to the working directory.
|
||||
|
||||
```yaml
|
||||
- name: Define a list of cache dependency globs
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: |
|
||||
@@ -110,7 +111,7 @@ changes. If you use relative paths, they are relative to the working directory.
|
||||
|
||||
```yaml
|
||||
- name: Define an absolute cache dependency glob
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "/tmp/my-folder/requirements*.txt"
|
||||
@@ -118,7 +119,7 @@ changes. If you use relative paths, they are relative to the working directory.
|
||||
|
||||
```yaml
|
||||
- name: Never invalidate the cache
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: ""
|
||||
@@ -131,7 +132,7 @@ By default, the cache will be restored.
|
||||
|
||||
```yaml
|
||||
- name: Don't restore an existing cache
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
restore-cache: false
|
||||
@@ -139,13 +140,15 @@ By default, the cache will be restored.
|
||||
|
||||
## Save cache
|
||||
|
||||
You can also disable saving the cache after the run with the `save-cache` input.
|
||||
You can control saving the cache after the run with the `save-cache` input.
|
||||
This can be useful to save cache storage when you know you will not use the cache of the run again.
|
||||
By default, the cache will be saved.
|
||||
By default, `save-cache: auto` saves the cache except for `merge_group` events, where caches created
|
||||
for temporary merge queue refs are unlikely to be reused. Cache restoration remains enabled for
|
||||
these events. Set `save-cache: true` to save the cache for all events.
|
||||
|
||||
```yaml
|
||||
- name: Don't save the cache after the run
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
save-cache: false
|
||||
@@ -171,7 +174,7 @@ It defaults to `setup-uv-cache` in the `TMP` dir, `D:\a\_temp\setup-uv-cache` on
|
||||
|
||||
```yaml
|
||||
- name: Define a custom uv cache path
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
cache-local-path: "/path/to/cache"
|
||||
```
|
||||
@@ -188,7 +191,7 @@ If you want to prune the cache before saving it, enable cache pruning with the `
|
||||
|
||||
```yaml
|
||||
- name: Prune the cache before saving it
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
prune-cache: true
|
||||
@@ -207,7 +210,7 @@ To force managed Python installs, set `UV_PYTHON_PREFERENCE=only-managed`.
|
||||
|
||||
```yaml
|
||||
- name: Cache Python installs
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-python: true
|
||||
@@ -225,7 +228,7 @@ If you want to ignore this, set the `ignore-nothing-to-cache` input to `true`.
|
||||
|
||||
```yaml
|
||||
- name: Ignore nothing to cache
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
enable-cache: true
|
||||
ignore-nothing-to-cache: true
|
||||
|
||||
+31
-6
@@ -4,26 +4,51 @@ This document covers advanced customization options including checksum validatio
|
||||
|
||||
## Validate checksum
|
||||
|
||||
Downloaded executables are automatically verified using checksums bundled with this action or,
|
||||
Downloaded archives are automatically verified using checksums bundled with this action or,
|
||||
for newer, not yet bundled versions, the checksum from [`astral-sh/versions`](https://github.com/astral-sh/versions).
|
||||
You can specify a checksum to override those values. The sha256 hashes can also be found on the
|
||||
[releases page](https://github.com/astral-sh/uv/releases) of the uv repo.
|
||||
|
||||
```yaml
|
||||
- name: Install a specific version and validate the checksum
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: "0.3.1"
|
||||
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
|
||||
```
|
||||
|
||||
For an additional layer of protection, you can set `require-checksums: true`.
|
||||
This prevents setup-uv from trusting an unknown version's checksum from
|
||||
[`astral-sh/versions`](https://github.com/astral-sh/versions) *unless* it is also
|
||||
present in the action's own bundled data *or* explicitly provided with `checksum`.
|
||||
|
||||
This can be combined with `version: latest-known` to select the newest bundled release,
|
||||
meaning that this newer requires an external checksum source:
|
||||
|
||||
```yaml
|
||||
- name: Install the latest known version of uv
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: latest-known
|
||||
require-checksums: true
|
||||
```
|
||||
|
||||
With this mode, you'll need to update setup-uv itself to get newer uv versions
|
||||
*unless* you explicitly pass in a `checksum` with a version that post-dates the setup-uv
|
||||
release.
|
||||
|
||||
On runners with a persistent tool cache, this mode reuses only installations previously verified
|
||||
against the same digest. The first run may download uv again.
|
||||
|
||||
## Manifest file
|
||||
|
||||
By default, setup-uv reads version metadata from
|
||||
[`astral-sh/versions`](https://github.com/astral-sh/versions).
|
||||
the [Astral mirror](https://releases.astral.sh/github/versions/main/v1/uv.ndjson).
|
||||
If the mirror request fails, it falls back to [`astral-sh/versions`](https://github.com/astral-sh/versions).
|
||||
|
||||
The `manifest-file` input lets you override that source with your own URL, for example to test
|
||||
custom uv builds or alternate download locations.
|
||||
custom uv builds or alternate download locations. Custom manifest URLs do not fall back to the
|
||||
default sources.
|
||||
|
||||
### Format
|
||||
|
||||
@@ -40,7 +65,7 @@ The `archive_format` field is currently ignored.
|
||||
|
||||
```yaml
|
||||
- name: Use a custom manifest file
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
manifest-file: "https://example.com/my-custom-manifest.ndjson"
|
||||
```
|
||||
@@ -59,7 +84,7 @@ You can disable this by setting the `add-problem-matchers` input to `false`.
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv without problem matchers
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
add-problem-matchers: false
|
||||
```
|
||||
@@ -9,7 +9,7 @@ This allows directly using it in later steps:
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv and activate the environment
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
activate-environment: true
|
||||
- run: uv pip install pip
|
||||
@@ -32,7 +32,7 @@ key: build-${{ runner.os }}-${{ runner.arch }}-${{ steps.setup-uv.outputs.python
|
||||
You can customize the venv location with `venv-path`, for example to place it in the runner temp directory:
|
||||
|
||||
```yaml
|
||||
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
activate-environment: true
|
||||
venv-path: ${{ runner.temp }}/custom-venv
|
||||
@@ -50,12 +50,13 @@ You can customize the venv location with `venv-path`, for example to place it in
|
||||
|
||||
## GitHub authentication token
|
||||
|
||||
By default, this action resolves available uv versions from
|
||||
[`astral-sh/versions`](https://github.com/astral-sh/versions), then downloads uv artifacts from
|
||||
GitHub Releases.
|
||||
By default, this action fetches version metadata and uv archives from the Astral mirror.
|
||||
If a manifest request fails, it falls back to `raw.githubusercontent.com`. If an archive download
|
||||
fails, it falls back to GitHub Releases.
|
||||
|
||||
You can provide a token via `github-token` to authenticate those downloads. By default, the
|
||||
`GITHUB_TOKEN` secret is used, which is automatically provided by GitHub Actions.
|
||||
You can provide a token via `github-token` to authenticate GitHub Releases downloads. The token
|
||||
is not sent to the Astral mirror or used for manifest requests. By default, the `GITHUB_TOKEN`
|
||||
secret is used, which is automatically provided by GitHub Actions.
|
||||
|
||||
If the default
|
||||
[permissions for the GitHub token](https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)
|
||||
@@ -63,7 +64,7 @@ are not sufficient, you can provide a custom GitHub token with the necessary per
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv with a custom GitHub token
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
||||
```
|
||||
@@ -81,7 +82,7 @@ input:
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv with a custom tool dir
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
tool-dir: "/path/to/tool/dir"
|
||||
```
|
||||
@@ -100,7 +101,7 @@ If you want to change this behaviour (especially on self-hosted runners) you can
|
||||
|
||||
```yaml
|
||||
- name: Install the latest version of uv with a custom tool bin dir
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
tool-bin-dir: "/path/to/tool-bin/dir"
|
||||
```
|
||||
@@ -117,7 +118,7 @@ This action supports expanding the `~` character to the user's home directory fo
|
||||
|
||||
```yaml
|
||||
- name: Expand the tilde character
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
cache-local-path: "~/path/to/cache"
|
||||
tool-dir: "~/path/to/tool/dir"
|
||||
@@ -134,7 +135,7 @@ If you want to ignore this, set the `ignore-empty-workdir` input to `true`.
|
||||
|
||||
```yaml
|
||||
- name: Ignore empty workdir
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
ignore-empty-workdir: true
|
||||
```
|
||||
@@ -144,6 +145,7 @@ If you want to ignore this, set the `ignore-empty-workdir` input to `true`.
|
||||
This action sets several environment variables that influence uv's behavior and can be used by subsequent steps:
|
||||
|
||||
- `UV_PYTHON`: Set when `python-version` is specified or the selected `.tool-versions` file contains a supported `python` entry. Controls which Python version uv uses.
|
||||
- `UV_PYTHON_ARCH`: Set when `python-arch` is specified. Controls the architecture of Python requests that do not specify one.
|
||||
- `UV_CACHE_DIR`: Set when caching is enabled (unless already configured in uv config files). Controls where uv stores its cache.
|
||||
- `UV_TOOL_DIR`: Set when `tool-dir` input is specified. Controls where uv installs tool environments.
|
||||
- `UV_TOOL_BIN_DIR`: Set when `tool-bin-dir` input is specified. Controls where uv installs tool binaries.
|
||||
@@ -155,10 +157,11 @@ This action sets several environment variables that influence uv's behavior and
|
||||
- `UV_NO_MODIFY_PATH`: If set, prevents the action from modifying PATH. Cannot be used with `activate-environment`.
|
||||
- `UV_CACHE_DIR`: If already set, the action will respect it instead of setting its own cache directory.
|
||||
- `UV_PYTHON`: If already set and `python-version` is not specified, the action will respect it instead of using the `python` entry from `.tool-versions`.
|
||||
- `UV_PYTHON_ARCH`: If already set and `python-arch` is not specified, the action will use it and include it in the cache key. Requires a uv version that supports `UV_PYTHON_ARCH`.
|
||||
|
||||
```yaml
|
||||
- name: Example using environment variables
|
||||
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
python-version: "3.12"
|
||||
tool-dir: "/custom/tool/dir"
|
||||
|
||||
@@ -38,7 +38,7 @@ Material failures are unauthorized executable selection, credential disclosure,
|
||||
### Security invariants
|
||||
|
||||
1. **Published runtime:** review `action.yml`, committed `dist/*.cjs`, and runner-interpreted shipped files; source-only fixes do not protect consumers.
|
||||
2. **Executable identity:** precedence is workflow version, version file, project configuration, then `latest`. Manifest authority, platform, variant, URL, checksum, mirror fallback, extraction, and cache placement must bind the intended artifact. A tool-cache hit bypasses download validation and depends on cache provenance.
|
||||
2. **Executable identity:** precedence is workflow version, version file, project configuration, then `latest`. Manifest authority, platform, variant, URL, checksum, mirror fallback, extraction, and cache placement must bind the intended artifact. A tool-cache hit bypasses download validation and depends on cache provenance. With `require-checksums`, only entries keyed by the explicit or bundled archive digest are eligible.
|
||||
3. **Credential recipients:** tokens and URL credentials may reach only workflow-authorized origins, redirects, paths, and logs. Metadata authority does not imply token-recipient authority.
|
||||
4. **Executable boundaries:** checkout-selected interpreters are authorized by default. Explicit workflow selections must win, and independent cache, runner, or remote state must not substitute executables or gain additional authority.
|
||||
5. **Paths and action channels:** path/environment changes, virtual-environment clearing, outputs, state, and problem matchers must affect only authorized targets and keep untrusted values as data.
|
||||
|
||||
Generated
+2069
-1968
File diff suppressed because it is too large.
Load diff
+7
-7
@@ -45,18 +45,18 @@
|
||||
"@actions/io": "^3.0.2",
|
||||
"@actions/tool-cache": "^4.0.0",
|
||||
"@renovatebot/pep440": "^5.0.0",
|
||||
"smol-toml": "^1.7.1",
|
||||
"undici": "^8.10.0"
|
||||
"smol-toml": "^1.8.0",
|
||||
"undici": "^8.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.5.8",
|
||||
"@biomejs/biome": "^2.5.14",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^26.2.0",
|
||||
"@types/node": "^26.6.2",
|
||||
"@types/semver": "^7.8.0",
|
||||
"@vercel/ncc": "^0.44.1",
|
||||
"@vercel/ncc": "^0.45.0",
|
||||
"esbuild": "^0.28.2",
|
||||
"jest": "^30.4.2",
|
||||
"js-yaml": "^5.2.3",
|
||||
"jest": "^30.5.2",
|
||||
"js-yaml": "^5.4.1",
|
||||
"ts-jest": "^29.4.11",
|
||||
"typescript": "^6.0.3"
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ const builds = [
|
||||
},
|
||||
{
|
||||
entryPoints: ["src/save-cache.ts"],
|
||||
// @actions/cache compares error.name to the error constructor's name.
|
||||
keepNames: true,
|
||||
outfile: "dist/save-cache/index.cjs",
|
||||
staleOutfiles: ["dist/save-cache/index.mjs"],
|
||||
},
|
||||
|
||||
Vendored
+60
@@ -0,0 +1,60 @@
|
||||
import { readdir, readlink, realpath, symlink, unlink } from "node:fs/promises";
|
||||
import nodePath from "node:path";
|
||||
|
||||
export async function repairPythonJunctions(pythonDir: string): Promise<void> {
|
||||
const entries = await readdir(pythonDir, { withFileTypes: true });
|
||||
const directories = new Set(
|
||||
entries
|
||||
.filter((entry) => entry.isDirectory())
|
||||
.map((entry) => entry.name.toLowerCase()),
|
||||
);
|
||||
|
||||
for (const entry of entries) {
|
||||
const name = entry.name.toLowerCase();
|
||||
if (!entry.isSymbolicLink() || !/^cpython-\d+\.\d+[+-].+$/.test(name)) {
|
||||
continue;
|
||||
}
|
||||
const link = nodePath.join(pythonDir, entry.name);
|
||||
let target: string;
|
||||
try {
|
||||
target = nodePath.resolve(pythonDir, await readlink(link));
|
||||
} catch (err) {
|
||||
// Fail only if the link still has the access error that requires repair.
|
||||
if (await resolvesWithAccessDenied(link)) {
|
||||
throw err;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// uv omits only the patch and prerelease from its minor-version links.
|
||||
const sibling = nodePath.relative(pythonDir, target).toLowerCase();
|
||||
const version = /^(cpython-\d+\.\d+)\.\d+(?:(?:a|b|rc)\d+)?([+-].+)$/.exec(
|
||||
sibling,
|
||||
);
|
||||
if (
|
||||
!version ||
|
||||
version[1] + version[2] !== name ||
|
||||
!directories.has(sibling)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
// Git for Windows tar can restore a junction as a file symlink when it
|
||||
// extracts the link before its target. Opening it as a directory fails.
|
||||
if (!(await resolvesWithAccessDenied(link))) {
|
||||
continue;
|
||||
}
|
||||
// An inaccessible installation can also cause EPERM through a valid link.
|
||||
await realpath(target);
|
||||
await unlink(link);
|
||||
await symlink(target, link, "junction");
|
||||
}
|
||||
}
|
||||
|
||||
async function resolvesWithAccessDenied(link: string): Promise<boolean> {
|
||||
try {
|
||||
await realpath(link);
|
||||
return false;
|
||||
} catch (err) {
|
||||
return (err as NodeJS.ErrnoException).code === "EPERM";
|
||||
}
|
||||
}
|
||||
Vendored
+25
-23
@@ -4,6 +4,7 @@ import { hashFiles } from "../hash/hash-files";
|
||||
import type { SetupInputs } from "../utils/inputs";
|
||||
import * as log from "../utils/logging";
|
||||
import { getArch, getOSNameVersion, getPlatform } from "../utils/platforms";
|
||||
import { repairPythonJunctions } from "./repair-python-junctions";
|
||||
|
||||
export const STATE_CACHE_KEY = "cache-key";
|
||||
export const STATE_CACHE_MATCHED_KEY = "cache-matched-key";
|
||||
@@ -44,6 +45,9 @@ export async function restoreCache(
|
||||
inputs.pythonDir,
|
||||
STATE_PYTHON_CACHE_MATCHED_KEY,
|
||||
"python-cache-hit",
|
||||
// TODO: Remove this repair once @actions/cache preserves Windows junctions.
|
||||
// https://github.com/actions/toolkit/issues/2562
|
||||
process.platform === "win32" ? repairPythonJunctions : undefined,
|
||||
);
|
||||
} else {
|
||||
core.setOutput("python-cache-hit", false);
|
||||
@@ -55,21 +59,33 @@ async function restoreCacheFromKey(
|
||||
cachePath: string,
|
||||
stateKey: string,
|
||||
outputKey: string,
|
||||
afterRestore?: (cachePath: string) => Promise<void>,
|
||||
): Promise<void> {
|
||||
log.info(
|
||||
`Trying to restore cache from GitHub Actions cache with key: ${cacheKey}`,
|
||||
);
|
||||
let matchedKey: string | undefined;
|
||||
try {
|
||||
matchedKey = await cache.restoreCache([cachePath], cacheKey);
|
||||
const matchedKey = await cache.restoreCache([cachePath], cacheKey);
|
||||
if (!matchedKey) {
|
||||
log.info(`No GitHub Actions cache found for key: ${cacheKey}`);
|
||||
core.setOutput(outputKey, false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Record the match before the post-restore hook so the post step can skip
|
||||
// archiving the directory again even if the hook fails. A PR that restored
|
||||
// from its base branch could otherwise save the broken copy in its own cache.
|
||||
core.saveState(stateKey, matchedKey);
|
||||
await afterRestore?.(cachePath);
|
||||
log.info(
|
||||
`cache restored from GitHub Actions cache with key: ${matchedKey}`,
|
||||
);
|
||||
core.setOutput(outputKey, true);
|
||||
} catch (err) {
|
||||
const message = (err as Error).message;
|
||||
log.warning(message);
|
||||
core.setOutput(outputKey, false);
|
||||
return;
|
||||
}
|
||||
|
||||
handleMatchResult(matchedKey, cacheKey, stateKey, outputKey);
|
||||
}
|
||||
|
||||
async function computeKeys(
|
||||
@@ -98,26 +114,12 @@ async function computeKeys(
|
||||
? `-${encodeURIComponent(inputs.cacheSuffix)}`
|
||||
: "";
|
||||
const version = encodeURIComponent(pythonVersion ?? "unknown");
|
||||
const pythonArchKey = inputs.pythonArch
|
||||
? `-python-${encodeURIComponent(inputs.pythonArch)}`
|
||||
: "";
|
||||
const platform = await getPlatform();
|
||||
const osNameVersion = getOSNameVersion();
|
||||
const pruned = inputs.pruneCache ? "-pruned" : "";
|
||||
const python = inputs.cachePython ? "-py" : "";
|
||||
return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${osNameVersion}-${version}${pruned}${python}${cacheDependencyPathHash}${suffix}`;
|
||||
}
|
||||
|
||||
function handleMatchResult(
|
||||
matchedKey: string | undefined,
|
||||
primaryKey: string,
|
||||
stateKey: string,
|
||||
outputKey: string,
|
||||
): void {
|
||||
if (!matchedKey) {
|
||||
log.info(`No GitHub Actions cache found for key: ${primaryKey}`);
|
||||
core.setOutput(outputKey, false);
|
||||
return;
|
||||
}
|
||||
|
||||
core.saveState(stateKey, matchedKey);
|
||||
log.info(`cache restored from GitHub Actions cache with key: ${matchedKey}`);
|
||||
core.setOutput(outputKey, true);
|
||||
return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${osNameVersion}-${version}${pythonArchKey}${pruned}${python}${cacheDependencyPathHash}${suffix}`;
|
||||
}
|
||||
@@ -23,11 +23,7 @@ export async function validateChecksum(
|
||||
: (knownChecksum ?? (hasManifestChecksum ? manifestChecksum : undefined));
|
||||
|
||||
if (checksumToUse === undefined) {
|
||||
if (manifestChecksum !== undefined) {
|
||||
throw new Error(`No checksum found for ${key} in manifest.`);
|
||||
}
|
||||
core.debug(`No checksum found for ${key}.`);
|
||||
return;
|
||||
throw new Error(`No checksum found for ${key} in manifest.`);
|
||||
}
|
||||
|
||||
const checksumSource = hasProvidedChecksum
|
||||
|
||||
+396
@@ -1,4 +1,400 @@
|
||||
{
|
||||
"aarch64-apple-darwin-0.13.9": "5aeca67f2283f75235de40d0bd9c0a5bbc5fce23b6d48b3bf9fa1b2db08382ca",
|
||||
"aarch64-pc-windows-msvc-0.13.9": "72eed595983a4d7d22d79f21065b0f4479cc7e5c7a89104bb410c8f47559a878",
|
||||
"aarch64-unknown-linux-gnu-0.13.9": "0797542018e541a9288855df555c8077eed06f7a47d206362030480e8ecc9f3d",
|
||||
"aarch64-unknown-linux-musl-0.13.9": "37fbb7c5bc66cf99c12aa881949d216181e201dec449772c4329e56487d61179",
|
||||
"arm-unknown-linux-musleabihf-0.13.9": "b43b18e668c94f60e39fb91994cd5b4f17474f81d4967039071afb8f18a6b72d",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.9": "8bd2ce216e6d3fe825ec0fde4532dea708964e8c419844d2ed8e9e7901a7a11e",
|
||||
"armv7-unknown-linux-musleabihf-0.13.9": "477c4d3759aaf68d76e570da03438d80a6445118e2a3d74500a98144c54324db",
|
||||
"i686-pc-windows-msvc-0.13.9": "eb4bd7285a512ebc4122f65a21b72e3f7072610d62164f43ca6aca280c39f6fd",
|
||||
"i686-unknown-linux-gnu-0.13.9": "ef1d3f7464e650d639f41f10130b2d9cb06d4171dd9778beb7f93a6d498812c5",
|
||||
"i686-unknown-linux-musl-0.13.9": "0fc2dc2355d4d9c8b3695c3a0aedeb6d62ef921e6e78db1bbc0ff32857b944b7",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.9": "5c074a4a008037787c665081116b5b7bc77161d1b5b47ca936732f84b498b317",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.9": "96543eb42d59426db0092f1d860f319abb87c83aaa413a9710108cbd4f68c34b",
|
||||
"riscv64gc-unknown-linux-musl-0.13.9": "0cf8c79c766dcbbc641e2a40f7433491c279a5b39869d6138bcd1c71adf82f93",
|
||||
"s390x-unknown-linux-gnu-0.13.9": "7e15c75fbd907334790d60037e492877ed053dff82cc1c0e2a1de0825d0d3864",
|
||||
"x86_64-apple-darwin-0.13.9": "617a3211261b0fc739562f0071aa34e9739797c510208ede8e2977c30903d041",
|
||||
"x86_64-pc-windows-msvc-0.13.9": "edd61f7f5728a56cc62455386661860bdfc7bab65872f39b0c25bdcc1d8e1beb",
|
||||
"x86_64-unknown-linux-gnu-0.13.9": "a7fbaff2b9a271d85c1bdb540941090fd1ce011797b4abeb48e4dcd39c2471d5",
|
||||
"x86_64-unknown-linux-musl-0.13.9": "58ccf5f1792b8a5a88d01bc910ea131a8b3db4a319a17ad5fad75e0845a3e271",
|
||||
"aarch64-apple-darwin-0.13.8": "6b71028a6b904f2ae3340ef52e595512de807d06c0a20eaef2f692581b246558",
|
||||
"aarch64-pc-windows-msvc-0.13.8": "59e6d919bed1f72035e622a7c930058f08a8931c4c78ceaf9f56e7fb74dd2c48",
|
||||
"aarch64-unknown-linux-gnu-0.13.8": "74f2f5c6024d397481db228db8fc25eed420db192243f88438c118e7e013e585",
|
||||
"aarch64-unknown-linux-musl-0.13.8": "0c6f8593fcf1eadfc60e663b685c408267559d7c5d61c689bbb9f3a7e369ba32",
|
||||
"arm-unknown-linux-musleabihf-0.13.8": "1ddb914171ea853439e5f3f7d2c82f2cccd423d350707e1b6b397d10b53e7ad4",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.8": "079618cfa7110f0bf812355cc030d3f309b2ebc085c3c8bcb7c291edf874d57d",
|
||||
"armv7-unknown-linux-musleabihf-0.13.8": "8378d009ea93bea8131d3bf6316c76bef1bf3c167e1efa0bcf9b32f8c6be92ac",
|
||||
"i686-pc-windows-msvc-0.13.8": "4fbc1489e659e46acc9f39215c2f849a8f6cca76cea2a34ab88bb203d6be4548",
|
||||
"i686-unknown-linux-gnu-0.13.8": "a02ef14274bdd62f5f8563df42fbaddee622af3673b6779aeb8a838930945130",
|
||||
"i686-unknown-linux-musl-0.13.8": "58d36909387012b6dd977ad31290345ad26c54b470c4534509795d2eeaf2234b",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.8": "4b7857be36535a31dc1e670b79d663bc278f1177e53d3e499e1ed300b72cbd14",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.8": "ac218efd4ecbc5f08878146003ee5f2c96a837e43e89a973dd5b681d2430e53c",
|
||||
"riscv64gc-unknown-linux-musl-0.13.8": "4bcdf839b7bf234cca080797c2d86c5c77b34e3c2e065666d08ba8c201c03fa0",
|
||||
"s390x-unknown-linux-gnu-0.13.8": "0b4bb8c6003acb8aca89696d9a10edd310b7336d3f30aa77a59ecfd0b39385af",
|
||||
"x86_64-apple-darwin-0.13.8": "a04c2ffeac28b2003a2c13caf538ab425fcd7def3e4a41571f4a8fb370a66af3",
|
||||
"x86_64-pc-windows-msvc-0.13.8": "529e78a9cec6cd7e3e014f7ecd8bda0c113969d4ed0f2efeedb85c30943325b8",
|
||||
"x86_64-unknown-linux-gnu-0.13.8": "5acfd9177cfecf0bf87578f059728215ccc884388988f55f7a65041b57387d91",
|
||||
"x86_64-unknown-linux-musl-0.13.8": "61fb26dabc4f0cf1d050fc6c67d40e43e4fae2994af21ebc1e050b233bf2b5ed",
|
||||
"aarch64-apple-darwin-0.13.7": "81b811b57e4624df7ed3aac148e0359100d9962f3d9dce00aec533dc2e086731",
|
||||
"aarch64-pc-windows-msvc-0.13.7": "505d9e65e7692bac3ddf98c66754aa26c5050c409c184af30a881a0a72cc85e3",
|
||||
"aarch64-unknown-linux-gnu-0.13.7": "71279f8d3c67241e807b9d8db872d1bf541579fb9f08b7d1eb1682196d1e57dc",
|
||||
"aarch64-unknown-linux-musl-0.13.7": "2d3ec076a0c4c0e8250bb6418c44080828b544f1a3be0b6e46adf9fb6923de45",
|
||||
"arm-unknown-linux-musleabihf-0.13.7": "2c029d1eda470c667e46a36fc5e2479c9a3e4af91e0cabcde07711bf40d587a9",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.7": "5e2a1315a1b8b4a25250d536f62fa5c1ab5ed17233e7bf486c3c7849cb663284",
|
||||
"armv7-unknown-linux-musleabihf-0.13.7": "4a1a7dc0b1713bbeac665a2f95e680eea3bb7ecebea226ae3b2de552bc72e88b",
|
||||
"i686-pc-windows-msvc-0.13.7": "fa2abbf16f7d12cb01c9b7f313d843218fbd91a9d3fab487cc06a1d6765b27bf",
|
||||
"i686-unknown-linux-gnu-0.13.7": "cc4f86390f9c99e8f53530e5e7f2cdc6ae7c011c9e805764332a3e3c01a378e4",
|
||||
"i686-unknown-linux-musl-0.13.7": "c2d50f5c64eb81fd1fd1ec5870403c0533fe4b6bf76f940cc5e97824e49ab782",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.7": "e8b65412482f848743e73566808f5bb480e826c9ce25361997891fcf71299080",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.7": "48aff38af87c7c8255beb9b51b3676598045786ac5197de15fea54ebfe6c72e1",
|
||||
"riscv64gc-unknown-linux-musl-0.13.7": "6c2e67417dda9661e67c2591a6226805ef2ed8ebc203baeed411f67d459207b2",
|
||||
"s390x-unknown-linux-gnu-0.13.7": "2b64a479b905b9cdab99c71105e523a0d7aa79581cbd716d40bce26d7b595428",
|
||||
"x86_64-apple-darwin-0.13.7": "20c47e4c1f630b8abaff8c291fa9b9aa300fef92c4fbff95adf198b55287cda7",
|
||||
"x86_64-pc-windows-msvc-0.13.7": "0cdc5b38fe5a8168ed6a25814f5ba43c21d313dd3187314fccb37b7cec46e021",
|
||||
"x86_64-unknown-linux-gnu-0.13.7": "c5221ff41b7892bfc223543883600125f6a47fe845093e0f5bdff4f359196d83",
|
||||
"x86_64-unknown-linux-musl-0.13.7": "287491da03f2a785c70fa75b13e1f849918c2f2b5415fe84876b8214eeb792f9",
|
||||
"aarch64-apple-darwin-0.13.6": "60fbd5c8a1ed681845eea28d9d622fcde03c51e91a43465b64a1e17db1ed3472",
|
||||
"aarch64-pc-windows-msvc-0.13.6": "c2426c0c8e28b53d8c440e47a18d96ad4db51e159866c0e81435b196d7f0081c",
|
||||
"aarch64-unknown-linux-gnu-0.13.6": "229e194255c7958d86d56e8790d969a6f74736592133f0dfd0076f754c642c1d",
|
||||
"aarch64-unknown-linux-musl-0.13.6": "819692e404d23e5aae6bc44c0e260f1f5492fd1910ab4693b2c650f926dbe800",
|
||||
"arm-unknown-linux-musleabihf-0.13.6": "57ac0f7c04deb42c5d686b4eeeef555c442db6ffea16fe4cbd7adb0384403794",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.6": "d00cd4949c4524c934afcfee1aedfa9d337cf4e43be4d6b692ad8d74d0a65562",
|
||||
"armv7-unknown-linux-musleabihf-0.13.6": "b215398c886e8cc2cfa282fe346c02025957f8633b75a3d4fd848e0adda4eddd",
|
||||
"i686-pc-windows-msvc-0.13.6": "32ceb64db231cbedfd499f7654c72e4c0b564f2846f9e76c0a4a7b2d03d7e67c",
|
||||
"i686-unknown-linux-gnu-0.13.6": "665ea831c38d342900950e606beb2ccc37b7ba0fcefc37b814eb4b076305f2b6",
|
||||
"i686-unknown-linux-musl-0.13.6": "de3a015c4b0fce63c178ae4fa95c94c873adfd92fa1e258c6a2a94e529812629",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.6": "3b2847185ec2946fcc928500efef7e3e74c255d3be6f2cb435081a84885d8c6c",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.6": "517052603ed46483b59d8875c9c61a577946b8f493c73e4339e45e7b119171d0",
|
||||
"riscv64gc-unknown-linux-musl-0.13.6": "659a95dc6aee3ecf86742a08d8ca6c6261422121cbd41decc0042f5a71af6305",
|
||||
"s390x-unknown-linux-gnu-0.13.6": "fb56d731308aa5c7718059d71afcb14d9a933a974997cee3d4eb5d06fc462a4b",
|
||||
"x86_64-apple-darwin-0.13.6": "63ba17fdda55ad1a230d4b37fc6017ffa10c23688c83818bd3bfdf914c652a02",
|
||||
"x86_64-pc-windows-msvc-0.13.6": "a2a8820d5eea32f08ef467ef3b7f66883a9b076d5737a2fc2fbb5f458d1bb50f",
|
||||
"x86_64-unknown-linux-gnu-0.13.6": "f29c3e94ffabd7e6f3ba521dba169a9b7ec12100bf3257087f0f24f6123f3645",
|
||||
"x86_64-unknown-linux-musl-0.13.6": "5d61f26b6c7213779eda90edc6971ea6b0b796bfb8d49a574c8ad69b59838548",
|
||||
"aarch64-apple-darwin-0.13.5": "743f85035a1996ecb350659e01cd9faea9709829be09b1b4b03c73eaf3c9cd73",
|
||||
"aarch64-pc-windows-msvc-0.13.5": "09f47edf90726084a70f9426f6e3ca4f46e9bf7cbf23b1716ec64d60b055fae3",
|
||||
"aarch64-unknown-linux-gnu-0.13.5": "4bb69cf95ed13f23713bb7bc09f241896ea0c75b7c557e615a20604b82f9c403",
|
||||
"aarch64-unknown-linux-musl-0.13.5": "7906c79adb21c81abd559841ba76bb1d9af9d791acac7a041b2972e03ae16538",
|
||||
"arm-unknown-linux-musleabihf-0.13.5": "0ffc73aead06a19ed9b63fb7f81f6376d12146829d509dda1585a8bfa3256f5e",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.5": "fe6b5b1d30b28b9dec45cfd8f60fec38941e18a8f9b1e64530dd197aba68dd07",
|
||||
"armv7-unknown-linux-musleabihf-0.13.5": "980649d802ee0c41127184f0d8c0461d1f0004e967246df9602bbb9ab983ca7f",
|
||||
"i686-pc-windows-msvc-0.13.5": "96228420d0a89a64757afba59932c1e58c4977e4122f2cc9f8615a51ba2d3084",
|
||||
"i686-unknown-linux-gnu-0.13.5": "f5713d6c05d77d01de9655270d713ba87ed45391752f489c80bbf1690bccc17c",
|
||||
"i686-unknown-linux-musl-0.13.5": "ef427365b5e84790d3f807bd0dfda0d8ee89e78f47e0cfdf86378a5bd9b13894",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.5": "f891bc62de89832775d5104ad3b3332848122536a8dc8bac5775a18cce42b845",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.5": "5c2692ecbf3a9d2c5955c403b30e61740b3ea2fdcc9b6eb533eeda268bf2b56d",
|
||||
"riscv64gc-unknown-linux-musl-0.13.5": "485ffd2d7623fd98f791cb6ab45aa967f1605e3f691666fc49713e3feb2362b9",
|
||||
"s390x-unknown-linux-gnu-0.13.5": "b383e82d562f269fffbb69f44258ae278b6f4b45fbe7e572574669021b547e94",
|
||||
"x86_64-apple-darwin-0.13.5": "b0f52b0e3945b4107d89024ea38e625683011fbfc05a0d98f9fa2d6dcee28c66",
|
||||
"x86_64-pc-windows-msvc-0.13.5": "a38b8d1902b7cfbc76b423ba1bb456f623f42064cdc72628b6075b89afd1019a",
|
||||
"x86_64-unknown-linux-gnu-0.13.5": "f68d291c75783122dad58ab77def0e13f3233f358731db5d6d7e8715603b928f",
|
||||
"x86_64-unknown-linux-musl-0.13.5": "57ef9d9ccb01fb1bd998df995b0dd221b52f7d7841fbea93f2d4463bf61fb7a9",
|
||||
"aarch64-apple-darwin-0.13.4": "e0b1d4743ce64c55d9f0f4a444afa6b81125680070ee04e853fcd0f6c1ebf8f1",
|
||||
"aarch64-pc-windows-msvc-0.13.4": "c4bc5a9534b2bb6a12fe29ea748445e1a6f9cb7bb275211c4fb74c52ecf317a5",
|
||||
"aarch64-unknown-linux-gnu-0.13.4": "1ae72b4718729e2ccc4f1ae2c6d1e531ca8467800e0546e9130b3886023a60ab",
|
||||
"aarch64-unknown-linux-musl-0.13.4": "253a17cadcb659ae77a0fe3b9a2f1c14297528d480c421899e61e64d64f24e8f",
|
||||
"arm-unknown-linux-musleabihf-0.13.4": "86df14c4dc6d98822b84c9fdf1ad626e2d4a81be60c49bd56a8840b9b70d9fdc",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.4": "9e52201e4502e349f27020879283736ca184185363ec8328554fd26596e61eb8",
|
||||
"armv7-unknown-linux-musleabihf-0.13.4": "d69261a33fbfabf3ff811ccd1f964920919a4f45bbcbd867913369cbfb32d0e3",
|
||||
"i686-pc-windows-msvc-0.13.4": "b450f623b34bf85322bbc656d5879915acd818dc5b05fc2d33e343da26799e37",
|
||||
"i686-unknown-linux-gnu-0.13.4": "8c72700f224979886ab41003a46cbac5a8ba070ff5857717026a3b4b144c5686",
|
||||
"i686-unknown-linux-musl-0.13.4": "985ef009e3bb182ce701c7911cd8d6296ccf2690b6dfd434972fbf64ff3f9057",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.4": "ae7320fcf963ed6ca19bacf436cf5d71cd5c9fbaf66450d614e7673c1f876be4",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.4": "0173f624fd99811a12c1e1d1b0c476d9e850b3408ab01b8d513028376fb1c9c0",
|
||||
"riscv64gc-unknown-linux-musl-0.13.4": "250aa02f66cf080651f13c9696dece1023f1e38a825f9c9a8f21627ccb3a3ef2",
|
||||
"s390x-unknown-linux-gnu-0.13.4": "e2ccfa8c19d340cd282c91f715dd37b7f0c5efa9b256c0a6c373fec3e01ec20d",
|
||||
"x86_64-apple-darwin-0.13.4": "7be2dcd316122f4b3e5a0a7889f6248266c14425374e105ff7dc9779184603a6",
|
||||
"x86_64-pc-windows-msvc-0.13.4": "ccec7508a07d9933d7cb1261880633efcf1f30d6e6eddab21823f1dae6f23225",
|
||||
"x86_64-unknown-linux-gnu-0.13.4": "2b428396f12572d4429cf210ca234dd599a33b3af0958a4d5ed569d63e3f344f",
|
||||
"x86_64-unknown-linux-musl-0.13.4": "28d4385f9f9d1d1c7654d85b3855e0e2615b2f6cc13136a2edff858bbdc16ff1",
|
||||
"aarch64-apple-darwin-0.13.3": "bf1e4fb6f5f5079a2902ad3f3a9e2d337575b226a1378f2449d8404353650608",
|
||||
"aarch64-pc-windows-msvc-0.13.3": "aeaca1a1b721c1686c09b4aa23d57f938df049bed1b8e534b5bf79a032b8b87b",
|
||||
"aarch64-unknown-linux-gnu-0.13.3": "611ff684f193a84d2fdad29c5f12505d02ece94984c7c982cdde950eba5c95b9",
|
||||
"aarch64-unknown-linux-musl-0.13.3": "4a58785768ab0577497ca7940be2f9fd5a34e48c3fd37923692fc0a81d71ac9f",
|
||||
"arm-unknown-linux-musleabihf-0.13.3": "ad9f4041e97b723da4238295b531850e31fd007f807b60040dc82d982268220c",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.3": "51a2ba864b76824fc208a91c1e2da02caf475036e083268a2974af69024aa867",
|
||||
"armv7-unknown-linux-musleabihf-0.13.3": "3cd65b49fe3e163d538b306b1eebdbbf80bd95bb498f863db917a2554f4fe5ec",
|
||||
"i686-pc-windows-msvc-0.13.3": "887d05656858bb9402a9d094c371012e7a1227cde4ddb84898b3a940673d17dd",
|
||||
"i686-unknown-linux-gnu-0.13.3": "91565a548a4b8b9ad78b5b6db534ca217cd9851b214419ca6d0af3e5d85a6e09",
|
||||
"i686-unknown-linux-musl-0.13.3": "3df2a0dc3f309156740c0088022f26ea0aa121ce6bc27d6afeedce25026e35e8",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.3": "fed4c6e245cce9eaaa050daec4f19a469bb8e329e45d0832a03581df5aa41e38",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.3": "ef5cdc493ede8705aa350d15d9b96e73d3f8c2e583e344a94d25910414e7a8c4",
|
||||
"riscv64gc-unknown-linux-musl-0.13.3": "77961b8ba0fbb10fa5f95c09fb36c31c76468a427a17fa175dc7ec6d7b7312b1",
|
||||
"s390x-unknown-linux-gnu-0.13.3": "ef70e576e895cd5c997125bbdcdbb2913df07f135cda5becf5e22fbd2fcd7661",
|
||||
"x86_64-apple-darwin-0.13.3": "5c35634957db7ebd9c2e4cc6c66b8979fb2c26a6b0dbd1d214d6acbac4033a89",
|
||||
"x86_64-pc-windows-msvc-0.13.3": "bb701bd35b586c45966654ea2703c9bd116a6a4fc0a8ca755bd644c2c41c5ebe",
|
||||
"x86_64-unknown-linux-gnu-0.13.3": "e4f169ec380f1793b898a6f1fcbacd22db25cf7ca0349a6e96ffb85b69998d04",
|
||||
"x86_64-unknown-linux-musl-0.13.3": "a36fca4c151d1ac13707984a88a4e2742edec0f2bc1b3e1c18c1c751e4679fd3",
|
||||
"aarch64-apple-darwin-0.13.2": "4a5d878cd0db3a57d79eec638c275e71c394e10533ae54c77b33d940866f53b7",
|
||||
"aarch64-pc-windows-msvc-0.13.2": "305d3a87a3c83ced9a9347e0b2e9d1719013db1ed8d7b34ba42ee1558f968686",
|
||||
"aarch64-unknown-linux-gnu-0.13.2": "3143e25fccac6f81b3b400792caa2ec431a5e8824d855cde9550a25f0fac8ea0",
|
||||
"aarch64-unknown-linux-musl-0.13.2": "b7444ae484d951d856b1ea0bae8224bf0ea856e9cefe8bd67c6d3f5d98375c78",
|
||||
"arm-unknown-linux-musleabihf-0.13.2": "e3c5eadb268ca0422229ff2fba05af5d6440a86dbd5e3ac83db508c8599ada11",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.2": "239ad77579931c9599ac7468bd02ac8de710ff349a99e76d52e32fb4206cd2f5",
|
||||
"armv7-unknown-linux-musleabihf-0.13.2": "c453906c4c80754e30e5305c05d92aff1b5023a5b96c57e9ddbb17fcf82f34e9",
|
||||
"i686-pc-windows-msvc-0.13.2": "3790797c9597310c412fadb10f5cfbc529dcc6e7ec7d1240e108cf56e3ab88c5",
|
||||
"i686-unknown-linux-gnu-0.13.2": "f8fcad706f05c435e6de5a0e38eb96604041629ef279c6309501636d0b88a237",
|
||||
"i686-unknown-linux-musl-0.13.2": "050646f5f9b75eb5db2fe215ffa49ea6bf166c678b5541659f3d7b4a6ca9537a",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.2": "2c1ea5b57b7a6a0251c050aafb5c3c51866f18b380336553a5ec525d9aaed446",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.2": "a28c0bd7156a06ed5b5fabe8e44ef5e402c592dfb60c5053da22e52bd6fb4cf9",
|
||||
"riscv64gc-unknown-linux-musl-0.13.2": "da6129b8acee2e9636a78367c761ef685e6ae2818a77cfffe2427ea52cae1ba4",
|
||||
"s390x-unknown-linux-gnu-0.13.2": "307987b9bbcfac0eefe5d71eb1fec08bce0cdad5b70306cf3fa7a57430e5cad2",
|
||||
"x86_64-apple-darwin-0.13.2": "08f0cb0d63a012ffa07659d1872030c1110fccdd665d49bc3683b0ca262b4a62",
|
||||
"x86_64-pc-windows-msvc-0.13.2": "9cfb447a4027550f134753253fdffbcd35b79a66dd888260bf6776891916069e",
|
||||
"x86_64-unknown-linux-gnu-0.13.2": "e14d48c117ec33601d6f860dda47aa5ea490d77a5a9ef770529c448fa6747d9f",
|
||||
"x86_64-unknown-linux-musl-0.13.2": "aba5d9e0af3662ee85772c5da147c3824cd6728a50bce6c507ae20672df7e83e",
|
||||
"aarch64-apple-darwin-0.13.1": "cfe454573412ff7380d15fc7dae5997ab53ffce72fce0a78e91ddbc84001acd2",
|
||||
"aarch64-pc-windows-msvc-0.13.1": "ec7846a5939b4654afee24f2d82bf6fde71bd7a6952d7748f1135ab301dd0a49",
|
||||
"aarch64-unknown-linux-gnu-0.13.1": "9041c73c99fdc5892cf128140beb354eca9231d502068cc36e6cb53a8e59ad14",
|
||||
"aarch64-unknown-linux-musl-0.13.1": "345a8308e4d1835cdfaadf692836fd3137a6d45864773f05ad7bf59442b1ba16",
|
||||
"arm-unknown-linux-musleabihf-0.13.1": "68d35d155ed7555da1fa811e16b1f8711227e5bcf0c5d45bbc7282333ec82970",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.1": "833bb2b4a47ba2aa4356e577eb52be2deb15d145d79e559dfe8fcc3bf546017b",
|
||||
"armv7-unknown-linux-musleabihf-0.13.1": "443b8bc3e4ef03b20b38aa1b03bc0604f55dfa74e091b7acc4851bcd5e5d6c58",
|
||||
"i686-pc-windows-msvc-0.13.1": "fcebe7cd3be7e2b1b4b5802bac36c85eeb724837c48be48d41a226367ef7d4a3",
|
||||
"i686-unknown-linux-gnu-0.13.1": "99645fd8923859e74a8f481d4f949318dae47beb65adc4b13a73f2582da9f853",
|
||||
"i686-unknown-linux-musl-0.13.1": "8fd67e5a8d3ef4ec75acda39d16df00821e2b0728f1f0e7f8aef24101ba88ddf",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.1": "66b890c75291de97617705dcc275a3e4ed99446e73b93c7748c6ca28d6793203",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.1": "52d9f0677840c20a14ed037a6cba515cc2f20a03001aaa605f928e80f4b55ec2",
|
||||
"riscv64gc-unknown-linux-musl-0.13.1": "b60c852c5a072640a624438935ffc1eddc4c38842c8422db890d6912e5d586d3",
|
||||
"s390x-unknown-linux-gnu-0.13.1": "d04236f6631a514824e06ce45f1b4832edfb43648d2e9fed2188c9fc66d8c95f",
|
||||
"x86_64-apple-darwin-0.13.1": "bb7b805bdcf3d0bc8c74ceb94569e6b3e8aa35bd492acdbb9d46bf46d9d4ff6b",
|
||||
"x86_64-pc-windows-msvc-0.13.1": "3b2661a463a5baea7f5076ea2b25ab71d77f36a6c0d809e5350651792f80a672",
|
||||
"x86_64-unknown-linux-gnu-0.13.1": "eadd9d27c134ab5ac1ffd4473b97a741407f3ea238288f03121fc4deddf90220",
|
||||
"x86_64-unknown-linux-musl-0.13.1": "6c86040a8f045ab9adc9e3ec4cdafa03fd00e9a988ed2bf28971c7fc2d0debd0",
|
||||
"aarch64-apple-darwin-0.13.0": "a9c1b29002cf3c83f07fa9cd8a887a3be0107d90e23189721221e7257db8e3d6",
|
||||
"aarch64-pc-windows-msvc-0.13.0": "cb54028b59aa87f11cf6dec293ce000420043a49a8aea522e822a671321f8932",
|
||||
"aarch64-unknown-linux-gnu-0.13.0": "3ccfb6af6e242433eb552f7d9676abd5412c6595c497e990d9c8cb7b5bd4d2c3",
|
||||
"aarch64-unknown-linux-musl-0.13.0": "281ca6cf43f4e26e35474839ad4861be86de42af2682f74134460f5b2071b96d",
|
||||
"arm-unknown-linux-musleabihf-0.13.0": "3f981753e12b6fcf705e05fe00bfe41366c5b5c260ebcea76965821dfc8f6c94",
|
||||
"armv7-unknown-linux-gnueabihf-0.13.0": "e38957791fdd56d356421d81a509b66680d47478870082519340361e5abdbb8b",
|
||||
"armv7-unknown-linux-musleabihf-0.13.0": "8c4e1f37dfcafa8244f0e8f1cd38f1ee597e5091c6e21a60fdd674987f69f8a2",
|
||||
"i686-pc-windows-msvc-0.13.0": "5fca2da976672231e3dcc1d81bb1059781dea3915715fe8f000a916886d183cb",
|
||||
"i686-unknown-linux-gnu-0.13.0": "4ee76d4f81003f04a1aeb6c743330d41a45054f2c69ceee4afdd129dd2786f88",
|
||||
"i686-unknown-linux-musl-0.13.0": "fd9fe1435115fc62fda26cac28b024998d2af39f093f107ef51692d8e24ac7b4",
|
||||
"powerpc64le-unknown-linux-gnu-0.13.0": "2fac854f1249968b91cd3bd6a089faf4cf7f896e407b9e1b3bc03ea0f0373989",
|
||||
"riscv64gc-unknown-linux-gnu-0.13.0": "90f660b61ffb8cefae7a60e1b5915ab3eb828266f6d4593279440f735dcded63",
|
||||
"riscv64gc-unknown-linux-musl-0.13.0": "6bfb5a8f9dce279e12f3ce1b57bef1a51b62ceb1de2c6233b61617883f23d56d",
|
||||
"s390x-unknown-linux-gnu-0.13.0": "7b7b733e9b44eb0d1f5f6275672653c08f5abe2dd930acdc64123d5c69593132",
|
||||
"x86_64-apple-darwin-0.13.0": "5f44dcbde809b632f47c36fadb241cb4d6f9af71d0c8f172b5d2026d3dde742c",
|
||||
"x86_64-pc-windows-msvc-0.13.0": "088962f9e7b7bd9ea740c04c650b2a21c8928c345bd99ac24350dc924dba656c",
|
||||
"x86_64-unknown-linux-gnu-0.13.0": "1468ebd5a5541121837c5a2817b9972ba6090fa6caa3d142620850a47fb75154",
|
||||
"x86_64-unknown-linux-musl-0.13.0": "b0828fc4cdc47d65951e94b5f0a15a5364420e8dcd88723f3b21e7a2eb30bbc3",
|
||||
"aarch64-apple-darwin-0.12.24": "0c4346de7abdb49495b393b9ec809fe387aa43e586be20fecb972216c1e71732",
|
||||
"aarch64-pc-windows-msvc-0.12.24": "4b783bda5cc44bbae0651a837223873a7acee31152381aef5fc86ef6bef25997",
|
||||
"aarch64-unknown-linux-gnu-0.12.24": "5231be65f496304623895dacdbf1de8504fec90303684bdf05805aa34414dd21",
|
||||
"aarch64-unknown-linux-musl-0.12.24": "7f9ab4726d743b6a92e310477a7840c8a8a7b3938cb3c4657d541342fca75011",
|
||||
"arm-unknown-linux-musleabihf-0.12.24": "c134b64ba9d6e760625ff9239708dffaeb67b612ebb47a774470bd88fac32084",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.24": "7ae5772338fb28f33052c06f82d1acb245df7bc1cb7628184a9baf91e9a101cd",
|
||||
"armv7-unknown-linux-musleabihf-0.12.24": "fe46d0ad949c2901be0ead471109cfed57a082d4ff037cf64d7c7c65e910cdf2",
|
||||
"i686-pc-windows-msvc-0.12.24": "752eda106495f96849951831a419f63796a01dc73ce5ab3cae6d48239527a06e",
|
||||
"i686-unknown-linux-gnu-0.12.24": "89dde6d09ef1ae1e548b78c035ee75d0e2127b6c3991e0754651021c57110296",
|
||||
"i686-unknown-linux-musl-0.12.24": "1d86de046c8be1ed1d7ea383f52469056145ee86a57fb11db5a51b4446d3d365",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.24": "897c61e780aded8062c9011f009b5d2971891b7e97df013c2ae10fca6fd41425",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.24": "c7789e1b3575c4c5a95a73ce280cd7335e4e1d8bf2aa90c606e33c5e3625d2e5",
|
||||
"riscv64gc-unknown-linux-musl-0.12.24": "1adf83ae63acc09d7bd4926f6a1a0d26f819df6972635c0e57aa29d21e1d9797",
|
||||
"s390x-unknown-linux-gnu-0.12.24": "9d2863b384a60f1c44c3e642226d1ffa97c0e6275cbb41f83aa2cdd764f8397c",
|
||||
"x86_64-apple-darwin-0.12.24": "4fa82e37cb94767661f532b001e470b67a186c7260e305bd84ddb78fd545c0b6",
|
||||
"x86_64-pc-windows-msvc-0.12.24": "7c38608c8a18ee137d748a1773053b07ec8f3a30fab49aebaa6f4e4efeceb019",
|
||||
"x86_64-unknown-linux-gnu-0.12.24": "b4dfaef47d491a7296981f8374a4595f55dbf84e8937c8ecd2983574d8bb3da6",
|
||||
"x86_64-unknown-linux-musl-0.12.24": "48170bd200a5430298c18f3b264485a1f3a8605f01088277daf6e37633edf0f5",
|
||||
"aarch64-apple-darwin-0.12.23": "50487ae565ccd96e499056b4674d438f4c53170202617b4c759defe0c6a1b544",
|
||||
"aarch64-pc-windows-msvc-0.12.23": "13294e232ececbe709c06b74e6ced06f2a225ea5591476685362f22be56a50d5",
|
||||
"aarch64-unknown-linux-gnu-0.12.23": "6524bd338177ed50d035d39354e12545e993bbeba2ecbddf0480c5b3a81d313f",
|
||||
"aarch64-unknown-linux-musl-0.12.23": "b536543cc4d50661986b165c76ee8aa9056e4fa332edcd153ff2e98760f9359b",
|
||||
"arm-unknown-linux-musleabihf-0.12.23": "7184501c712c58abc9554e1f4fcc9bacc042ad28e1ad0f42e762a1ed27a151c5",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.23": "4d568920e1f60c4b881cbe2827dfa20592a9a9721f69b57d47650d035c4fe8f6",
|
||||
"armv7-unknown-linux-musleabihf-0.12.23": "f5c941f2a7fa078ffcbc58654ec1b37de98e2a93a24cd3deb19c1acdd66ff533",
|
||||
"i686-pc-windows-msvc-0.12.23": "22a92f4374e4716c2848acaa0392f2f8e4a13b0ff65d080e2a5ade167bce96a8",
|
||||
"i686-unknown-linux-gnu-0.12.23": "52c93c40f6056c4d0e1e259acd60c11f7328416a4f28c85e5f1b04430538aeaa",
|
||||
"i686-unknown-linux-musl-0.12.23": "b3838649e6896734be828e96c6b14f3064882508a7211398c0e3a35f974f501b",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.23": "e8e13421bdecb3f31c0794edfcb8b2e04406f34d645fd9c040f7bd9ace5c3f72",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.23": "661c1a11afc8db4adb20b2d30f789b50e682529b0f1f49e3dd138d86581065b3",
|
||||
"riscv64gc-unknown-linux-musl-0.12.23": "d6dcc450fe1c159540115c8934c76515ee03192c9e61cb983228ad3809e1cc71",
|
||||
"s390x-unknown-linux-gnu-0.12.23": "50c726711cb5f4cdbf45e31c141c9033fdd43146f90ac630c252857c60daf84b",
|
||||
"x86_64-apple-darwin-0.12.23": "960da44cb4b73685206ddd250b19e0a117fa41095710c1038f081f5cb613efb4",
|
||||
"x86_64-pc-windows-msvc-0.12.23": "75d05de6762778c31ee183398de7dd15093fad0ed90b1f236d8205ea5ec00c90",
|
||||
"x86_64-unknown-linux-gnu-0.12.23": "9167d72b3319674b6303c4cbe071854bba13ebdf3d76b1a7cbdc175471fb66d6",
|
||||
"x86_64-unknown-linux-musl-0.12.23": "1cff8783850e794470aadb73f54b749542a511fc57b0ce6468b64bd3852e0ade",
|
||||
"aarch64-apple-darwin-0.12.22": "5d714de09501a59393ceca78f4bc232a50478729640d251907160299b2a93ddd",
|
||||
"aarch64-pc-windows-msvc-0.12.22": "6a42b919c2bb7135f07b4d1bb8e489f0eaab0bae039020573cc522d831e2d32e",
|
||||
"aarch64-unknown-linux-gnu-0.12.22": "6f66a14e8239871fb477f9746c941fedfa77e8fe28a8bc7c07e1dc7f53a66712",
|
||||
"aarch64-unknown-linux-musl-0.12.22": "228bd32c180421a94eef91378a92b2dd63c768bd278430e833250524c4a13382",
|
||||
"arm-unknown-linux-musleabihf-0.12.22": "e7df01f0b9cfec6a82232e0de063cb961e38e4e1a9767295bdee87e148f6dde0",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.22": "ec4d636bce8cc4d2ff0a927f2805671e2d7377e3f3f7b42109d5d4633839fa41",
|
||||
"armv7-unknown-linux-musleabihf-0.12.22": "5f5ea3f80f8ffa47aa47fb8f59b5589eb3619c05ffe7730d8554ead42720f742",
|
||||
"i686-pc-windows-msvc-0.12.22": "a18a913fe4435e5591113ff035077d9461177ad03ab2747eaeb88aee95833a16",
|
||||
"i686-unknown-linux-gnu-0.12.22": "221bbc2362b7cbf651e3fbb0a228c034820bb07f9efe2785c9339828fcdf079b",
|
||||
"i686-unknown-linux-musl-0.12.22": "50dadb6a043359f4762e338691306109ca1df3d3312460a926642dbf8c9f527c",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.22": "17b959094cffb2fd3c3fb9c64d98a1ea8eabfd0bc83507ab08e4ca2187302d1c",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.22": "f25202c8647b4a783b0f04e2c341c617d8d11a8bc72d4ccdcbcc6f0c9d7782f2",
|
||||
"riscv64gc-unknown-linux-musl-0.12.22": "30b29481b4dd28a8cc9d903b66dbe9532781bd25de817fcd9ea5fd37598ef171",
|
||||
"s390x-unknown-linux-gnu-0.12.22": "3672ce2d278239cbc52ba0c962f21556cd49f889a87577ea0801ad7eadc0be73",
|
||||
"x86_64-apple-darwin-0.12.22": "1b8a5b316883df2daf20fb9a446e5b230e01d947d57aba2694977c5ac5a7e98c",
|
||||
"x86_64-pc-windows-msvc-0.12.22": "ea1397797a0ca15f63516dd0f49c2dde9776db9be5861cab152ebe8ad199894d",
|
||||
"x86_64-unknown-linux-gnu-0.12.22": "b9980552309f09c15172b8be828555e375097f16deb459795ce7bfd200380f0b",
|
||||
"x86_64-unknown-linux-musl-0.12.22": "a50fd68c653b0cfb1c85e0a7db62cb78cf5c22b6f3dcf3ae173e5f222d084470",
|
||||
"aarch64-apple-darwin-0.12.21": "b88bda573e566ef9bced66b155fe0408626fbbc053aee1c30ba686f0728c9447",
|
||||
"aarch64-pc-windows-msvc-0.12.21": "93ed53b94e9cec000cacdfd18ca67bc4cb2b6a5f5ec041edd7f2a3dae365ce79",
|
||||
"aarch64-unknown-linux-gnu-0.12.21": "030b69227b40af8c1981b7301793dc66e71ed3c796ea8688209dd268bd91ec51",
|
||||
"aarch64-unknown-linux-musl-0.12.21": "67389a674e62adffa5a395d9a3b80688731c4aa7b33a6def3e62d00f7fec821f",
|
||||
"arm-unknown-linux-musleabihf-0.12.21": "047c43febfaabcf06f6e20361bf99a4fd57b9c391a99e0bff2d410dd647829a6",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.21": "ddb4826a23a9a994da3d868c57b74b1fcb22e29691fc89f8b1702c6a1a9e0df7",
|
||||
"armv7-unknown-linux-musleabihf-0.12.21": "eeb8edc4e5b74ec4521da4d3911153ba8ce24ed8557e2dbbe55d04a6d7a7f45e",
|
||||
"i686-pc-windows-msvc-0.12.21": "66b7ffe136362b8522748c4d43b7e82b846e37e4e9272fcfadffaad8bf7b5a75",
|
||||
"i686-unknown-linux-gnu-0.12.21": "b9ff98d9e6303f8d403af3f002ff1a429867cfcf915f1fa296689b43d9defd52",
|
||||
"i686-unknown-linux-musl-0.12.21": "1492353034d106f2067eeec8f8b6aad1354e13fbb3f91c25a40eb5d44215fd6f",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.21": "c76a8589ed7f447d1e14dc20f060861fecd457a44a287047ef6a49bc6f22ae25",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.21": "202b30dff0f35cd8094e97949c8694b31951f404dd99802e1c997d65d752cf58",
|
||||
"riscv64gc-unknown-linux-musl-0.12.21": "ca1dcb18c0e81c31d006d1ab808fcb4e3a95dde780b1e58805039f84a8ae0b2d",
|
||||
"s390x-unknown-linux-gnu-0.12.21": "556bd11fca37f43a5ec051b5ed82e64b54fe536d6dea2fa84f8b34d2eb3a77d0",
|
||||
"x86_64-apple-darwin-0.12.21": "2b336763b396ec6afa20c5a8b083538ca7402445b868311979d740a4344c17d8",
|
||||
"x86_64-pc-windows-msvc-0.12.21": "5d223efa0bf00208c3853246af09420419dfbd352536aa6bb8163d6170e23890",
|
||||
"x86_64-unknown-linux-gnu-0.12.21": "23f02075b652bb1df64178cfae41b5caf160822e720e2663568f3f5d63bc52c0",
|
||||
"x86_64-unknown-linux-musl-0.12.21": "d69d543a55ec9cdf9d3d9f2648b0a161847e3dbddc477e3be6b5813a6d46f639",
|
||||
"aarch64-apple-darwin-0.12.20": "848fdeb602ff1a1baacd4f6c8b7bdc6cf1ad026a6d9cf59475fda17c179743ca",
|
||||
"aarch64-pc-windows-msvc-0.12.20": "b6bd9218855591742ffd3b00fcf2044b4d2fb6446b6a3545e0dfee447e950388",
|
||||
"aarch64-unknown-linux-gnu-0.12.20": "8a7aad7bc76a2fae5151566ff3e43eacce0b2a113d5e4de3e4afe3e58fa2441e",
|
||||
"aarch64-unknown-linux-musl-0.12.20": "94bb13feeebc6b59a4124016c957cdc9ee406d1476ce2b2ce2991e95b8e820b7",
|
||||
"arm-unknown-linux-musleabihf-0.12.20": "6aeef64cf07b43135d6b1c20bd57809f2d965d0f8a2d5602230d5d55b8245477",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.20": "e1c53318608448ad3b8e7f2e9b069936730a6e7b47831ba5446e4b4f436ee715",
|
||||
"armv7-unknown-linux-musleabihf-0.12.20": "a4c3a0e12e5489f092c93b232ddc4a811a6ea9a03f447f91f88e96867c0bac8d",
|
||||
"i686-pc-windows-msvc-0.12.20": "1a372c273370ae9a7e9aa84020ce91fc1d9ebecbd287c3447e7e99cada0b14f3",
|
||||
"i686-unknown-linux-gnu-0.12.20": "f1e83cc88970ed799b507a8392152d19916dfa0b6c9ae9c8145742035a40d5cb",
|
||||
"i686-unknown-linux-musl-0.12.20": "11d541dd32dd779adbdfef69fe30d7d325036f50d394d3f260a0042998e05499",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.20": "39224a5bfc21a8041afc0315e5d47c86acecf4e669944564950996b516fb5987",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.20": "5cb9df36ca64fb72673c59a77b955b50f3bb907689a98d1d8d640aa3e71f2660",
|
||||
"riscv64gc-unknown-linux-musl-0.12.20": "360e91a317a27bd33978577c57b6f3ed778bdfe8c30c9b613e46fdc33bf8aee8",
|
||||
"s390x-unknown-linux-gnu-0.12.20": "25485439b52cb029afa724c442418ca08a53122100f8cce68ccceb88323ccde2",
|
||||
"x86_64-apple-darwin-0.12.20": "ac54283d211fd77cdc152b67606dbaf6406ff4ab03f3af4ae99468fa8e887141",
|
||||
"x86_64-pc-windows-msvc-0.12.20": "95f9bc30fbb3574d276e28ac4a6de932d25153645853d13da8c21eec3bc88d06",
|
||||
"x86_64-unknown-linux-gnu-0.12.20": "6590717592ace991ff83a63fef799e3ad9d33ecc8f96c5d6bdd732496e79337f",
|
||||
"x86_64-unknown-linux-musl-0.12.20": "14114d66a094f1907af0fcbc863f34226bbb7f5e430e13dce6676ba40dcc6891",
|
||||
"aarch64-apple-darwin-0.12.19": "a9a8df1eedeb192f2e47e40e2faabfb387db4b850209118786d42f89dde3e0ba",
|
||||
"aarch64-pc-windows-msvc-0.12.19": "115b54cb823bc48260670f5782001add6067ac8d98d18c8263a833704e287de9",
|
||||
"aarch64-unknown-linux-gnu-0.12.19": "0804e9b164c64b6914182d5920c08551958a095986f10a3731056df701126436",
|
||||
"aarch64-unknown-linux-musl-0.12.19": "ad8d8448a2ff642ba62c2f684d7dd22a03f8eb3fc9918c2c3e8ec975f4ed6710",
|
||||
"arm-unknown-linux-musleabihf-0.12.19": "173b6b118e444dc3b3a0b6337dd87d66fa79835aa5e059d79e942ae33a850e20",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.19": "f47fe74244c4adcff20637c1aee2550dbc31c81ccf0b2a9537bf98b24bc4028a",
|
||||
"armv7-unknown-linux-musleabihf-0.12.19": "0df353aac087509c47fe660837ca5d284858ef4a5eec4042cbcdeb0118ba0f1b",
|
||||
"i686-pc-windows-msvc-0.12.19": "e1c2d19d1173a0e9f81ba3f95881ad741808133e372610889ff6870629218c7f",
|
||||
"i686-unknown-linux-gnu-0.12.19": "952b0bae707e19b2b5d012b46519a2159be929273d466a1437759f0961be0b93",
|
||||
"i686-unknown-linux-musl-0.12.19": "f923ac32e0e5139950fe1b63abab74d48cabb94b15c90637bc380dadcaf4da40",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.19": "e30649ad846a14bd96440efd45fdb60dcdf8db088fb143064aa78632048ad957",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.19": "50a83ea999ea861a6a853ae1ad0982baad96cc6451e46a5d7e366c4d9475f1bb",
|
||||
"riscv64gc-unknown-linux-musl-0.12.19": "051de9eda7e09dab4c8a304ab2e119317649fee0e24efd0358f410d0c5b3407f",
|
||||
"s390x-unknown-linux-gnu-0.12.19": "e6a9149ea122c1b3b9719ca3577c321376e3c400e004c3cc18231fdb1d35107b",
|
||||
"x86_64-apple-darwin-0.12.19": "cb5fa57bafe68fc0fb94b17f06bee0b0b9a7feb94ccbd110445afa0696e39273",
|
||||
"x86_64-pc-windows-msvc-0.12.19": "6dbb02d79e419522f1c500f0adb1cddcff0cda7d59b0d66ea7f5e3b4a1b2f5f0",
|
||||
"x86_64-unknown-linux-gnu-0.12.19": "23bf5552d220e0842b65c862097b2ebaeba0064b74eda5e565e77fd25969d8c8",
|
||||
"x86_64-unknown-linux-musl-0.12.19": "db7278c9f57981338fddff1fb250e11964bc0a4fafcb9eed8303fdb117dc067b",
|
||||
"aarch64-apple-darwin-0.12.18": "cf40e0c6a202190ccd9e0406dcfdd5b2d6668a9a5c779b17948963df32aafe5b",
|
||||
"aarch64-pc-windows-msvc-0.12.18": "17f27b1c64eacc757ae603579f116a014881e486c5e79ae81877980d4699e943",
|
||||
"aarch64-unknown-linux-gnu-0.12.18": "afb6291f3f0a6b4521fc67b947822506c41dde5b60d2189dd8f3695b2ac8c9e7",
|
||||
"aarch64-unknown-linux-musl-0.12.18": "0796973fb3eea8095078c3d0659bd17a5f6789a71b8dd85caff2483178f78ac3",
|
||||
"arm-unknown-linux-musleabihf-0.12.18": "a37127fb331d5e6228efc1f8549d2447b50c907eee4629347f150a649083619c",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.18": "a38e82350e1e95d5526d1ab81d9b4eb676815c51646243b3b3fbc55b218732d1",
|
||||
"armv7-unknown-linux-musleabihf-0.12.18": "41f0808328f65910bacdb487638475715f949900c7a23b393b3754e2156ff15a",
|
||||
"i686-pc-windows-msvc-0.12.18": "e04c0f1fd9a8703761f9edd64d797ddb2c9a3e6eec0e2fed234a7bd2c2e868b9",
|
||||
"i686-unknown-linux-gnu-0.12.18": "278dbc5dfc6bdde33a553fdba53174cc49daf512a857db1b3c1b5d663290196f",
|
||||
"i686-unknown-linux-musl-0.12.18": "ebfdaaafc447fb2a7329cde879a7748b2ab40ecdcd3d5f04fc0a5d1ab79bb0bd",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.18": "332d174248230ed599a9df0e4e77d6921dbb42ca0fdfbe26eb2a6c999da936b3",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.18": "be88652a03225acbd6bf7204d006b244b0743c8c756a35137c209fa4ff731c41",
|
||||
"riscv64gc-unknown-linux-musl-0.12.18": "29d34dcc833b99b09f78fa11c66fa3c490c3e37c4f0d754e7b84f7147850190e",
|
||||
"s390x-unknown-linux-gnu-0.12.18": "ac412f7ab2a096a7302e0ae8828c7ef84db8a1f7ff97acba8ff8987d46d39cec",
|
||||
"x86_64-apple-darwin-0.12.18": "2e4108f5395397c8bc5d43bf83d3bdbb2d0e92b90d0efa607756be704905fa33",
|
||||
"x86_64-pc-windows-msvc-0.12.18": "cae6a3bc25239f83dffb467a4b180508d9da23986c04639ebfa44e43e6a84bff",
|
||||
"x86_64-unknown-linux-gnu-0.12.18": "89eadd7c76fc063887959510d5ba0ab1264dfd5f1143b925ddb73021a40acf16",
|
||||
"x86_64-unknown-linux-musl-0.12.18": "e38d97460b98ebfd31b197de0fe9fa578add4bc8ba0179b203dd3f87b99f98e6",
|
||||
"aarch64-apple-darwin-0.12.17": "85f00cbdc6dd3e97eba4c31b4d014375a9fdfe8f570023b84e5102fc3456896b",
|
||||
"aarch64-pc-windows-msvc-0.12.17": "3e1aa6849d77f0e00dc865e4afab5c5b32de053e21fe35bf5ad5cec3734ec976",
|
||||
"aarch64-unknown-linux-gnu-0.12.17": "d636d1b678e9e7f367ecb22b46bd1cabbed234d6bc3b4d96365d2b507f72f86c",
|
||||
"aarch64-unknown-linux-musl-0.12.17": "a6096da273d548cb9f277d237a01ac7344a39ef0f455c0e148e4dc9737c1596b",
|
||||
"arm-unknown-linux-musleabihf-0.12.17": "16a98a65ef8545f7c32cf717683aac44248369ffaa41c43e665341489359c654",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.17": "796e101976e18a0f92d90b6f3efd289f77fbc5afd1aaa6fdedd3c84c209eabab",
|
||||
"armv7-unknown-linux-musleabihf-0.12.17": "421c5f9c53d49088e705e7a64fea147082a2191178ea1d8c51d9ad758ca899f6",
|
||||
"i686-pc-windows-msvc-0.12.17": "1d3653cb6eafd1e675e979d7cd8eeac1456202f8927a2216419993077a4c473f",
|
||||
"i686-unknown-linux-gnu-0.12.17": "3faa79a70e2a1aa6eb3cd78eba02263f3e4b17b6be584a01429968f92ff74966",
|
||||
"i686-unknown-linux-musl-0.12.17": "fc05220cfa1c6585e0e209877c228393b25a96e17cd43028b06566ac894cd078",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.17": "eb6dbedaaa622af32cba2388e0d2d47e34c8724d4214a129d614b96f071d8e53",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.17": "65b807b24357133c49d97ca9394ee7e13ca62822e1095376c809654b35f39cf2",
|
||||
"riscv64gc-unknown-linux-musl-0.12.17": "87c339a735b578f285b961bebdefe0a671f3652477d1e84dc69cd1a829f45e92",
|
||||
"s390x-unknown-linux-gnu-0.12.17": "d99f69f47fc5e0975d6e7a5745cf2332317015caffb3bb81e5154cc7b66fa77a",
|
||||
"x86_64-apple-darwin-0.12.17": "8dcf05a8c809bb3c471d2b614788ba27a6e41298fc8c31ac84b5f4339fd468e5",
|
||||
"x86_64-pc-windows-msvc-0.12.17": "a252121d5b59398fcb137c6ea448176459a44010f33f67e0072305a637119ca7",
|
||||
"x86_64-unknown-linux-gnu-0.12.17": "fa82fd8dde8e8eefdecada6aa0889666556cfceb690d06e0c3bca49eb3070a63",
|
||||
"x86_64-unknown-linux-musl-0.12.17": "6401c4665d8fa2a9893e087c91f585430738e3170f5398a1141483efb4a93310",
|
||||
"aarch64-apple-darwin-0.12.16": "b6e03fae61704b1aa622f12b792a69483e837b83068e44f4fd34f8a07a8f74a3",
|
||||
"aarch64-pc-windows-msvc-0.12.16": "9977129f89c4036edfcb200d2484755571e51fa74517f02e478c1d7bcc353b2e",
|
||||
"aarch64-unknown-linux-gnu-0.12.16": "36d913ee9c647481d64f1a0a0485f85ff2feaee605c341fc22e73398f9212c26",
|
||||
"aarch64-unknown-linux-musl-0.12.16": "5beba1f35c0922fd086cce850ce919e55bc4e873c4fcda891343526afdb4c5b3",
|
||||
"arm-unknown-linux-musleabihf-0.12.16": "d91fa9dede60e851e4bb3ae8060300042bc6bf924476fae71898d2c08c46a9cf",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.16": "fbdfca5d4ace4a5abbf343c0f10a0b68c5eac0201073d2a504e32c57c0873669",
|
||||
"armv7-unknown-linux-musleabihf-0.12.16": "f5a3b6c7fbd4c7ea66cbd704d821ffed0d20abbfa8a12c2e68d6dd22476d308b",
|
||||
"i686-pc-windows-msvc-0.12.16": "0d4889cc6c4058f4fbc28f6c50ec09b528ef998547cac5c3425e1a0b8169e847",
|
||||
"i686-unknown-linux-gnu-0.12.16": "0e8743e653ed124c526a9e86ee6a08fa6eee7618a3f12cc9033c74674bd2047f",
|
||||
"i686-unknown-linux-musl-0.12.16": "f609686cbe67884eeb57daebd58eb0fef35f930dd92fd2c14e931da7515c7454",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.16": "312dc82f441debff371fe5fc0068b538787678d6d79edc86f028b011920a2f6a",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.16": "8b0142eee9d291c602218126e3fc558fe9bc1b7c8f1cc0b03dcd8df9f2f218a1",
|
||||
"riscv64gc-unknown-linux-musl-0.12.16": "188af30f025c35569b302b84793a4c286f6740902885d054917375edbfd0193c",
|
||||
"s390x-unknown-linux-gnu-0.12.16": "b90cc954c2cd52b695104e215189a0c8d9e6ceaee753c9be1a871bb8d969e9c3",
|
||||
"x86_64-apple-darwin-0.12.16": "a42bcc9ce97eb8b364d7f162233a9c6b8c0ee25388e551d362809795127e0c31",
|
||||
"x86_64-pc-windows-msvc-0.12.16": "f730454bf09019754e5e5abd71a8aa18683cb739cba0d9c720bac2e7c901160f",
|
||||
"x86_64-unknown-linux-gnu-0.12.16": "8e5c6e5523dffc2dcf615bd995554c84c9feb4e577808a3fb8698a639d3f8d9c",
|
||||
"x86_64-unknown-linux-musl-0.12.16": "a01206ffbd60f3a7ee30949be1863527986f5307494a064042c69ce7e6d44799",
|
||||
"aarch64-apple-darwin-0.12.15": "dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d",
|
||||
"aarch64-pc-windows-msvc-0.12.15": "a37c8e96cb1260488c8510b64c848533a3a82a2fdf9e905de7c2700ceebf6437",
|
||||
"aarch64-unknown-linux-gnu-0.12.15": "0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08",
|
||||
"aarch64-unknown-linux-musl-0.12.15": "93b801abb146e6431fb0434346a0162e65d3f0d1cd7360144d04c43488fd7f7d",
|
||||
"arm-unknown-linux-musleabihf-0.12.15": "9b0204dbd368a7a5f84d3ef015684c3b0e830911641ebf4575f44ad4901c1b3e",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.15": "a0afe9cfc7dc4acc18e613f68c5b010b849323b3a3d6e9311b29d289dc94f95e",
|
||||
"armv7-unknown-linux-musleabihf-0.12.15": "a113c782e6f96a56f73aba601cde73ddbe877e0a4179eabeb5b6e86be9bb75d9",
|
||||
"i686-pc-windows-msvc-0.12.15": "cc8b28f77cf19f7ed88569d6d9163e503ebc94e1b70069889852bcf38839c559",
|
||||
"i686-unknown-linux-gnu-0.12.15": "6fa19118f01ee547d5b9a3f4af389c5c929a34e0074a4313d3cdb3ce9c97fdcd",
|
||||
"i686-unknown-linux-musl-0.12.15": "b66d6cf7916addeda13fbb61abe003ecc62f048e3a213d6bd2494ca7e8022989",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.15": "5f49c97ae7ec25c45513466e00a32cacb148f3824367c7e498c0b53a270bc1e2",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.15": "4c8f75c5969737b67621957010df5337bb721a8d48fdbb1620f5d35c3f1dd268",
|
||||
"riscv64gc-unknown-linux-musl-0.12.15": "8c03514f57e517eb87a376deb3d6475045f6ce550956c6082910b4a529d08a47",
|
||||
"s390x-unknown-linux-gnu-0.12.15": "1f5701cb5eedc5a34d3dd5896ca3bf509b15d382b3448f370df46e0a631889c1",
|
||||
"x86_64-apple-darwin-0.12.15": "e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b",
|
||||
"x86_64-pc-windows-msvc-0.12.15": "477bd99a84e34891f2bd4c9152ddeb74e971accccbc59c0f0301f11f08a32d46",
|
||||
"x86_64-unknown-linux-gnu-0.12.15": "f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638",
|
||||
"x86_64-unknown-linux-musl-0.12.15": "999c0c3da986953e508985c3932d283d2c62eb167b4f8d81e79f565e34104959",
|
||||
"aarch64-apple-darwin-0.12.14": "dfed5683c5873d65eff8476eb93526059b81e5646a68305b5c94a26b29990894",
|
||||
"aarch64-pc-windows-msvc-0.12.14": "46b930bdbb338099c7d9da711b751240eb97876eda6a553a2c28323967232041",
|
||||
"aarch64-unknown-linux-gnu-0.12.14": "7fb91bd5d10529c60723eaec3caf44726f89280e5aeed78af8fc63fcad004c9b",
|
||||
"aarch64-unknown-linux-musl-0.12.14": "571b5c73c9bcc294f8087f22613edb7c7ceb191f4dbf8cafd3f2ff15e6147d36",
|
||||
"arm-unknown-linux-musleabihf-0.12.14": "6e0df0e690d5c29ce65ec6962d8b262a93e9951077f05d78943f858e7d6e9185",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.14": "c20a18bb275a6fc2599bc321d37e52650a449237c6111da203a1d73b45921b25",
|
||||
"armv7-unknown-linux-musleabihf-0.12.14": "a128725e1e40226a9309d603cbb4c36e272932092a77f4d0478ef2fb8eacaa05",
|
||||
"i686-pc-windows-msvc-0.12.14": "ddd9afd789c60a38d82f3021239e22daacc67b9ef0719345ee6f0dcc37ab93ae",
|
||||
"i686-unknown-linux-gnu-0.12.14": "de65ccdb90dd818248161db761ae3b6713b1b3230a1b55068ad327598b3a14b8",
|
||||
"i686-unknown-linux-musl-0.12.14": "268538a3b90c90f7d68d31ed781f0f2cb8618188019c8bb09ce0e7876bb54829",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.14": "6a6c2a91d6240700eb36895c3fb0533bd5e9c696a95e0a55f7a7ae844cbde537",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.14": "df2c854c77b1d32f75ef08282511b050066b3db9d7abc4dc2c23ea26227c6b74",
|
||||
"riscv64gc-unknown-linux-musl-0.12.14": "c6d0824ebdf23811dfa659148ae2c224b385d07ae1b4c282e5bf6abe3d603a74",
|
||||
"s390x-unknown-linux-gnu-0.12.14": "e01aec9706c88f93f90409eab42324571e2b2c9c2938aaa266ad048b37c52c6f",
|
||||
"x86_64-apple-darwin-0.12.14": "e11a70264ceca38e929ecaeed953c323e517af7b960ebf9722d5918e8c7f0375",
|
||||
"x86_64-pc-windows-msvc-0.12.14": "02cecb254f37f3396da625680796d3990164a590fb5611d46f719ad83e7b9a89",
|
||||
"x86_64-unknown-linux-gnu-0.12.14": "18ef5c3888ae59828cb13f38d57e9389b8173ecc719eff163bfafc74b38f5936",
|
||||
"x86_64-unknown-linux-musl-0.12.14": "df163630683e5a2106d3320e2a448fde8eda5e7b9b47f617c5c332769728e735",
|
||||
"aarch64-apple-darwin-0.12.13": "7e6ddb9316acc00f2296c82ff4d99977870ee34b2f0ddcae9444d714db9364ed",
|
||||
"aarch64-pc-windows-msvc-0.12.13": "1efb2654b06e7063d4ac1fc9d49a9bda9a6704d82f035b589a2751a592f14151",
|
||||
"aarch64-unknown-linux-gnu-0.12.13": "2eaa5d94f5db7b3a1a092156b9420459e42ab0217d917fe74a876309cef9b5e9",
|
||||
"aarch64-unknown-linux-musl-0.12.13": "f44bc1037a17889fe562fffd2002d4ed108e499fbe68b4f022af244dc7b8244f",
|
||||
"arm-unknown-linux-musleabihf-0.12.13": "2c7644f891edcf1e74a1b9dde96ea4ba00b41301c936c87e843683656703ada2",
|
||||
"armv7-unknown-linux-gnueabihf-0.12.13": "19252c4d21fce112817b9e07bef6b2e9c90cef80fe82659533105b37a772d067",
|
||||
"armv7-unknown-linux-musleabihf-0.12.13": "54e2c10e4e6c18a3efbac645ea02d7e6b768ae2f975275595915a7039e802b75",
|
||||
"i686-pc-windows-msvc-0.12.13": "4ddcdf859d3bd337a156a2fc567e685e4b3d61e07b4a2dbbed7aeb4325e116ac",
|
||||
"i686-unknown-linux-gnu-0.12.13": "beb56f6eda61bc69a8acc1bca07929365aa5cd2e912e35c35003a45e266d8a0e",
|
||||
"i686-unknown-linux-musl-0.12.13": "6c93a9703b6145266240cb2aeb31d3574c21b33570fddf92461707b906eb3a65",
|
||||
"powerpc64le-unknown-linux-gnu-0.12.13": "cd45ac73fc711e717602a4dc0c9e19d9c6563d15b14515a9a5dd49b00172a8b6",
|
||||
"riscv64gc-unknown-linux-gnu-0.12.13": "ff1fb4d7e4c1d3a4acc6eff69b2530e846964260469df345e0239059517c0a21",
|
||||
"riscv64gc-unknown-linux-musl-0.12.13": "b88312b410c1183e33ae9fa7738f35b7cd7396b2aa0e82836d7e88dbf23e5fb5",
|
||||
"s390x-unknown-linux-gnu-0.12.13": "d41e4784c2187c76970690a9e9a288231f5ec8d2160ad8464be74aa9c06717e8",
|
||||
"x86_64-apple-darwin-0.12.13": "5e287ef61cb6a9b61b3a83fef124fd143e400468a7dac794230147a810e17119",
|
||||
"x86_64-pc-windows-msvc-0.12.13": "a86c9dc7bad9b03f388583b7187c05fe9951c2e0d392217e8fd43d97787f6ec2",
|
||||
"x86_64-unknown-linux-gnu-0.12.13": "745765a3b6e360ad76743599ae5c42e9278c7edf8bbff9fc76d05bf2623a04dd",
|
||||
"x86_64-unknown-linux-musl-0.12.13": "4e2bfd0c9007b1032a50e539e965fd0a6037d87ad93ae1580d220a92d4c94098",
|
||||
"aarch64-apple-darwin-0.12.12": "46740540b63fdee9a6cb2e19baf3f1f475b850c440a33e63455087a6871263f1",
|
||||
"aarch64-pc-windows-msvc-0.12.12": "36559da51ecee83b2b1d80aa1a0ede2f80e2d9e5761fffcbb9e9366a7f3d022a",
|
||||
"aarch64-unknown-linux-gnu-0.12.12": "fe08db50cc1b56cd1da7801065ed1103d27ed3f9571cd122386cfc7faf1b8df5",
|
||||
|
||||
@@ -11,22 +11,40 @@ import {
|
||||
import * as log from "../utils/logging";
|
||||
import type { Architecture, Platform } from "../utils/platforms";
|
||||
import { validateChecksum } from "./checksum/checksum";
|
||||
import { KNOWN_CHECKSUMS } from "./checksum/known-checksums";
|
||||
import { getArtifact } from "./manifest";
|
||||
|
||||
export { resolveVersion } from "../version/resolve";
|
||||
|
||||
export function getIntrinsicChecksum(
|
||||
key: string,
|
||||
providedChecksum: string,
|
||||
): string {
|
||||
const checksum = providedChecksum || KNOWN_CHECKSUMS[key];
|
||||
if (!checksum) {
|
||||
throw new Error(
|
||||
`No bundled checksum for ${key}. With require-checksums enabled, update setup-uv or provide the checksum input for this archive.`,
|
||||
);
|
||||
}
|
||||
if (!/^[a-f0-9]{64}$/.test(checksum)) {
|
||||
throw new Error(`Expected a SHA-256 checksum for ${key}.`);
|
||||
}
|
||||
return checksum;
|
||||
}
|
||||
|
||||
export function tryGetFromToolCache(
|
||||
arch: Architecture,
|
||||
version: string,
|
||||
toolCacheName = TOOL_CACHE_NAME,
|
||||
): { version: string; installedPath: string | undefined } {
|
||||
core.debug(`Trying to get uv from tool cache for ${version}...`);
|
||||
const cachedVersions = tc.findAllVersions(TOOL_CACHE_NAME, arch);
|
||||
const cachedVersions = tc.findAllVersions(toolCacheName, arch);
|
||||
core.debug(`Cached versions: ${cachedVersions}`);
|
||||
let resolvedVersion = tc.evaluateVersions(cachedVersions, version);
|
||||
if (resolvedVersion === "") {
|
||||
resolvedVersion = version;
|
||||
}
|
||||
const installedPath = tc.find(TOOL_CACHE_NAME, resolvedVersion, arch);
|
||||
const installedPath = tc.find(toolCacheName, resolvedVersion, arch);
|
||||
return { installedPath, version: resolvedVersion };
|
||||
}
|
||||
|
||||
@@ -38,6 +56,7 @@ export async function downloadVersion(
|
||||
githubToken: string,
|
||||
manifestUrl?: string,
|
||||
downloadFromAstralMirror = true,
|
||||
toolCacheName = TOOL_CACHE_NAME,
|
||||
): Promise<{ version: string; cachedToolDir: string }> {
|
||||
const artifact = await getArtifact(version, arch, platform, manifestUrl);
|
||||
|
||||
@@ -71,6 +90,7 @@ export async function downloadVersion(
|
||||
resolvedChecksum,
|
||||
manifestChecksum,
|
||||
githubTokenForUrl(downloadUrl, githubToken),
|
||||
toolCacheName,
|
||||
);
|
||||
} catch (err) {
|
||||
if (mirrorUrl === undefined) {
|
||||
@@ -90,6 +110,7 @@ export async function downloadVersion(
|
||||
resolvedChecksum,
|
||||
manifestChecksum,
|
||||
githubTokenForUrl(artifact.downloadUrl, githubToken),
|
||||
toolCacheName,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -128,6 +149,7 @@ async function downloadArtifact(
|
||||
checksum: string | undefined,
|
||||
manifestChecksum: string | undefined,
|
||||
githubToken: string | undefined,
|
||||
toolCacheName: string,
|
||||
): Promise<{ version: string; cachedToolDir: string }> {
|
||||
log.info(`Downloading uv from "${downloadUrl}" ...`);
|
||||
const downloadPath = await tc.downloadTool(
|
||||
@@ -165,12 +187,7 @@ async function downloadArtifact(
|
||||
uvDir = path.join(extractedDir, artifactName);
|
||||
}
|
||||
|
||||
const cachedToolDir = await tc.cacheDir(
|
||||
uvDir,
|
||||
TOOL_CACHE_NAME,
|
||||
version,
|
||||
arch,
|
||||
);
|
||||
const cachedToolDir = await tc.cacheDir(uvDir, toolCacheName, version, arch);
|
||||
return { cachedToolDir, version };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { createInterface } from "node:readline";
|
||||
import { Readable } from "node:stream";
|
||||
import * as core from "@actions/core";
|
||||
import { VERSIONS_MANIFEST_URL } from "../utils/constants";
|
||||
import {
|
||||
GITHUB_VERSIONS_MANIFEST_URL,
|
||||
VERSIONS_MANIFEST_URL,
|
||||
} from "../utils/constants";
|
||||
import { fetch } from "../utils/fetch";
|
||||
import * as log from "../utils/logging";
|
||||
import { selectDefaultVariant } from "./variant-selection";
|
||||
@@ -167,6 +170,20 @@ export function clearManifestCache(manifestUrl?: string): void {
|
||||
}
|
||||
|
||||
async function fetchManifestResponse(manifestUrl: string) {
|
||||
try {
|
||||
return await fetchManifestResponseFromUrl(manifestUrl);
|
||||
} catch (error) {
|
||||
if (manifestUrl !== VERSIONS_MANIFEST_URL) {
|
||||
throw error;
|
||||
}
|
||||
log.info(
|
||||
`Failed to fetch manifest from Astral mirror, falling back to GitHub: ${(error as Error).message}`,
|
||||
);
|
||||
return await fetchManifestResponseFromUrl(GITHUB_VERSIONS_MANIFEST_URL);
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchManifestResponseFromUrl(manifestUrl: string) {
|
||||
let response: Awaited<ReturnType<typeof fetch>> | undefined;
|
||||
for (let attempt = 1; attempt <= MANIFEST_FETCH_ATTEMPTS; attempt++) {
|
||||
log.info(`Fetching manifest data from ${manifestUrl} ...`);
|
||||
|
||||
+4
-2
@@ -159,8 +159,10 @@ async function saveCacheToKey(
|
||||
}
|
||||
|
||||
log.info(`Including ${cacheName} path: ${cachePath}`);
|
||||
await cache.saveCache([cachePath], cacheKey);
|
||||
log.info(`${cacheName} saved with key: ${cacheKey}`);
|
||||
const cacheId = await cache.saveCache([cachePath], cacheKey);
|
||||
if (cacheId !== -1) {
|
||||
log.info(`${cacheName} saved with key: ${cacheKey}`);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
+29
-3
@@ -5,9 +5,14 @@ import * as exec from "@actions/exec";
|
||||
import { restoreCache } from "./cache/restore-cache";
|
||||
import {
|
||||
downloadVersion,
|
||||
getIntrinsicChecksum,
|
||||
tryGetFromToolCache,
|
||||
} from "./download/download-version";
|
||||
import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants";
|
||||
import {
|
||||
STATE_UV_PATH,
|
||||
STATE_UV_VERSION,
|
||||
TOOL_CACHE_NAME,
|
||||
} from "./utils/constants";
|
||||
import { CacheLocalSource, loadInputs, type SetupInputs } from "./utils/inputs";
|
||||
import * as log from "./utils/logging";
|
||||
import {
|
||||
@@ -16,6 +21,7 @@ import {
|
||||
getPlatform,
|
||||
type Platform,
|
||||
} from "./utils/platforms";
|
||||
import { setupPythonArch } from "./utils/python-arch";
|
||||
import { getPythonRuntimeId } from "./utils/python-runtime";
|
||||
import { resolveUvVersion } from "./version/resolve";
|
||||
|
||||
@@ -86,6 +92,11 @@ async function run(): Promise<void> {
|
||||
throw new Error(`Unsupported architecture: ${process.arch}`);
|
||||
}
|
||||
const setupResult = await setupUv(inputs, platform, arch);
|
||||
const uvPath = path.join(
|
||||
setupResult.uvDir,
|
||||
process.platform === "win32" ? "uv.exe" : "uv",
|
||||
);
|
||||
await setupPythonArch(uvPath, inputs.pythonArch, inputs.exportPythonArch);
|
||||
|
||||
addToolBinToPath(inputs);
|
||||
addUvToPathAndOutput(setupResult.uvDir);
|
||||
@@ -141,7 +152,21 @@ async function setupUv(
|
||||
versionFile: inputs.versionFile,
|
||||
workingDirectory: inputs.workingDirectory,
|
||||
});
|
||||
const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion);
|
||||
let checksum = inputs.checksum;
|
||||
let toolCacheName = TOOL_CACHE_NAME;
|
||||
if (inputs.requireChecksums) {
|
||||
checksum = getIntrinsicChecksum(
|
||||
`${arch}-${platform}-${resolvedVersion}`,
|
||||
inputs.checksum,
|
||||
);
|
||||
// A regular tool-cache entry may have been verified using a manifest checksum.
|
||||
toolCacheName = `${TOOL_CACHE_NAME}-${checksum}`;
|
||||
}
|
||||
const toolCacheResult = tryGetFromToolCache(
|
||||
arch,
|
||||
resolvedVersion,
|
||||
toolCacheName,
|
||||
);
|
||||
if (toolCacheResult.installedPath) {
|
||||
log.info(`Found uv in tool-cache for ${toolCacheResult.version}`);
|
||||
return {
|
||||
@@ -154,10 +179,11 @@ async function setupUv(
|
||||
platform,
|
||||
arch,
|
||||
resolvedVersion,
|
||||
inputs.checksum,
|
||||
checksum,
|
||||
inputs.githubToken,
|
||||
inputs.manifestFile,
|
||||
inputs.downloadFromAstralMirror,
|
||||
toolCacheName,
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -2,6 +2,8 @@ export const TOOL_CACHE_NAME = "uv";
|
||||
export const STATE_UV_PATH = "uv-path";
|
||||
export const STATE_UV_VERSION = "uv-version";
|
||||
export const VERSIONS_MANIFEST_URL =
|
||||
"https://releases.astral.sh/github/versions/main/v1/uv.ndjson";
|
||||
export const GITHUB_VERSIONS_MANIFEST_URL =
|
||||
"https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson";
|
||||
|
||||
/** GitHub Releases URL prefix for uv artifacts. */
|
||||
|
||||
+23
-1
@@ -24,10 +24,13 @@ export interface SetupInputs {
|
||||
version: string;
|
||||
versionFile: string;
|
||||
pythonVersion: string;
|
||||
pythonArch: string;
|
||||
exportPythonArch: boolean;
|
||||
activateEnvironment: boolean;
|
||||
noProject: boolean;
|
||||
venvPath: string;
|
||||
checksum: string;
|
||||
requireChecksums: boolean;
|
||||
enableCache: boolean;
|
||||
restoreCache: boolean;
|
||||
saveCache: boolean;
|
||||
@@ -54,13 +57,17 @@ export function loadInputs(): SetupInputs {
|
||||
const version = core.getInput("version");
|
||||
const versionFile = getVersionFile(workingDirectory);
|
||||
const pythonVersion = getPythonVersion(versionFile);
|
||||
const pythonArchInput = core.getInput("python-arch");
|
||||
const pythonArch = pythonArchInput || process.env.UV_PYTHON_ARCH || "";
|
||||
const exportPythonArch = pythonArchInput !== "";
|
||||
const activateEnvironment = core.getBooleanInput("activate-environment");
|
||||
const noProject = core.getBooleanInput("no-project");
|
||||
const venvPath = getVenvPath(workingDirectory, activateEnvironment);
|
||||
const checksum = core.getInput("checksum");
|
||||
const requireChecksums = core.getBooleanInput("require-checksums");
|
||||
const enableCache = getEnableCache();
|
||||
const restoreCache = core.getInput("restore-cache") === "true";
|
||||
const saveCache = core.getInput("save-cache") === "true";
|
||||
const saveCache = getSaveCache();
|
||||
const cacheSuffix = core.getInput("cache-suffix") || "";
|
||||
const cacheLocalPath = getCacheLocalPath(
|
||||
workingDirectory,
|
||||
@@ -94,15 +101,18 @@ export function loadInputs(): SetupInputs {
|
||||
checksum,
|
||||
downloadFromAstralMirror,
|
||||
enableCache,
|
||||
exportPythonArch,
|
||||
githubToken,
|
||||
ignoreEmptyWorkdir,
|
||||
ignoreNothingToCache,
|
||||
manifestFile,
|
||||
noProject,
|
||||
pruneCache,
|
||||
pythonArch,
|
||||
pythonDir,
|
||||
pythonVersion,
|
||||
quiet,
|
||||
requireChecksums,
|
||||
resolutionStrategy,
|
||||
restoreCache,
|
||||
saveCache,
|
||||
@@ -189,6 +199,18 @@ function getEnableCache(): boolean {
|
||||
return enableCacheInput === "true";
|
||||
}
|
||||
|
||||
function getSaveCache(): boolean {
|
||||
const saveCacheInput = core.getInput("save-cache");
|
||||
if (saveCacheInput === "auto") {
|
||||
if (process.env.GITHUB_EVENT_NAME === "merge_group") {
|
||||
log.info("Cache saving is disabled for the merge_group event");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return saveCacheInput === "true";
|
||||
}
|
||||
|
||||
function getToolBinDir(workingDirectory: string): string | undefined {
|
||||
const toolBinDirInput = core.getInput("tool-bin-dir");
|
||||
if (toolBinDirInput !== "") {
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
import { execFile } from "node:child_process";
|
||||
import { promisify } from "node:util";
|
||||
import * as core from "@actions/core";
|
||||
import * as log from "./logging";
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
const PROBE_ARCH = "setup-uv-probe";
|
||||
|
||||
export async function setupPythonArch(
|
||||
uvPath: string,
|
||||
pythonArch: string,
|
||||
exportPythonArch: boolean,
|
||||
): Promise<void> {
|
||||
if (pythonArch === "") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Older uv releases ignore unknown environment variables. An invalid architecture
|
||||
// confirms that uv recognizes UV_PYTHON_ARCH without finding or downloading Python.
|
||||
const probe = await queryPythonArch(uvPath, PROBE_ARCH);
|
||||
if (probe.exitCode === 0) {
|
||||
throw new Error(
|
||||
"The installed version of uv does not support UV_PYTHON_ARCH. Select a newer uv version or use an architecture-qualified python-version.",
|
||||
);
|
||||
}
|
||||
if (
|
||||
!probe.stderr.includes(
|
||||
`environment variable \`UV_PYTHON_ARCH\` with invalid value \`${PROBE_ARCH}\``,
|
||||
)
|
||||
) {
|
||||
throw new Error(
|
||||
`Failed to check uv's support for UV_PYTHON_ARCH: ${probe.stderr.trim() || `uv exited with code ${probe.exitCode}`}`,
|
||||
);
|
||||
}
|
||||
|
||||
const selected = await queryPythonArch(uvPath, pythonArch);
|
||||
if (selected.exitCode !== 0) {
|
||||
throw new Error(
|
||||
`Failed to set Python architecture to ${pythonArch}: ${selected.stderr.trim() || `uv exited with code ${selected.exitCode}`}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (exportPythonArch) {
|
||||
core.exportVariable("UV_PYTHON_ARCH", pythonArch);
|
||||
log.info(`Set UV_PYTHON_ARCH to ${pythonArch}`);
|
||||
}
|
||||
}
|
||||
|
||||
async function queryPythonArch(
|
||||
uvPath: string,
|
||||
pythonArch: string,
|
||||
): Promise<{ exitCode: number; stderr: string }> {
|
||||
try {
|
||||
const { stderr } = await execFileAsync(
|
||||
uvPath,
|
||||
["--no-config", "cache", "dir"],
|
||||
{
|
||||
encoding: "utf8",
|
||||
env: { ...process.env, NO_COLOR: "1", UV_PYTHON_ARCH: pythonArch },
|
||||
},
|
||||
);
|
||||
return { exitCode: 0, stderr };
|
||||
} catch (error) {
|
||||
if (
|
||||
error instanceof Error &&
|
||||
"code" in error &&
|
||||
typeof error.code === "number" &&
|
||||
"stderr" in error &&
|
||||
typeof error.stderr === "string"
|
||||
) {
|
||||
return { exitCode: error.code, stderr: error.stderr };
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -69,5 +69,7 @@ function getUvVersionFromAllDependencies(
|
||||
|
||||
function getUvVersionFromDependency(dependency: string): string | undefined {
|
||||
const dependencyWithoutMarker = dependency.split(";", 1)[0]?.trim();
|
||||
return dependencyWithoutMarker?.match(/^uv([=<>~!]+\S*)/)?.[1].trim();
|
||||
return dependencyWithoutMarker
|
||||
?.match(/^uv\s*((?:[=<>~!]+\s*[^\s,]+\s*,?\s*)+)/)?.[1]
|
||||
.replace(/\s/g, "");
|
||||
}
|
||||
+19
-3
@@ -169,7 +169,9 @@ async function findHighestSatisfyingVersion(
|
||||
): Promise<string | undefined> {
|
||||
// This fast path assumes uv releases are semver-monotonic: newer manifest
|
||||
// entries always have higher versions, with no lower-version backports.
|
||||
const semverRange = semver.validRange(versionSpecifier);
|
||||
const semverRange = isPep440Specifier(versionSpecifier)
|
||||
? null
|
||||
: semver.validRange(versionSpecifier);
|
||||
if (semverRange !== null) {
|
||||
const semverMatch = await getFirstMatchingVersion((version) =>
|
||||
semver.satisfies(version, semverRange),
|
||||
@@ -193,11 +195,23 @@ async function findHighestSatisfyingVersion(
|
||||
return pep440Match;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifiers that are valid PEP 440 must be evaluated as PEP 440. semver
|
||||
* accepts several of them with different semantics, e.g. `~=0.5` as `<0.6.0`
|
||||
* instead of `<1.0`, `<=0.5` as `<0.6.0` instead of `<=0.5.0` and `>0.5` as
|
||||
* `>=0.6.0` instead of `>0.5.0`.
|
||||
*/
|
||||
function isPep440Specifier(versionSpecifier: string): boolean {
|
||||
return pep440.validRange(versionSpecifier);
|
||||
}
|
||||
|
||||
function maxSatisfying(
|
||||
versions: string[],
|
||||
version: string,
|
||||
): string | undefined {
|
||||
const maxSemver = tc.evaluateVersions(versions, version);
|
||||
const maxSemver = isPep440Specifier(version)
|
||||
? ""
|
||||
: tc.evaluateVersions(versions, version);
|
||||
if (maxSemver !== "") {
|
||||
core.debug(`Found a version that satisfies the semver range: ${maxSemver}`);
|
||||
return maxSemver;
|
||||
@@ -218,7 +232,9 @@ function minSatisfying(
|
||||
versions: string[],
|
||||
version: string,
|
||||
): string | undefined {
|
||||
const minSemver = semver.minSatisfying(versions, version);
|
||||
const minSemver = isPep440Specifier(version)
|
||||
? null
|
||||
: semver.minSatisfying(versions, version);
|
||||
if (minSemver !== null) {
|
||||
core.debug(`Found a version that satisfies the semver range: ${minSemver}`);
|
||||
return minSemver;
|
||||
|
||||
@@ -21,8 +21,13 @@ export type ParsedVersionSpecifier =
|
||||
export function normalizeVersionSpecifier(specifier: string): string {
|
||||
const trimmedSpecifier = specifier.trim();
|
||||
|
||||
// Only strip `==` from full versions. A partial pin like `==0.5` means
|
||||
// `==0.5.0` in PEP 440, but `0.5` alone is read as the semver range `0.5.x`.
|
||||
if (trimmedSpecifier.startsWith("==")) {
|
||||
return trimmedSpecifier.slice(2);
|
||||
const pinnedVersion = trimmedSpecifier.slice(2).trim();
|
||||
if (tc.isExplicitVersion(pinnedVersion)) {
|
||||
return pinnedVersion;
|
||||
}
|
||||
}
|
||||
|
||||
return trimmedSpecifier;
|
||||
|
||||
Reference in new issue
Block a user