dependabot[bot] 77cc1aee22
Some checks failed
test-cache-windows / test-setup-cache (push) Waiting to run
test-cache-windows / test-restore-cache (push) Blocked by required conditions
test-cache / test-setup-cache (auto, selfhosted-ubuntu-arm64) (push) Waiting to run
test-cache / test-setup-cache (false, selfhosted-ubuntu-arm64) (push) Waiting to run
test-cache / test-setup-cache (true, selfhosted-ubuntu-arm64) (push) Waiting to run
test-cache / test-restore-cache (auto, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test-cache / test-restore-cache (auto, ubuntu-latest) (push) Blocked by required conditions
test-cache / test-restore-cache (false, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test-cache / test-restore-cache (false, ubuntu-latest) (push) Blocked by required conditions
test-cache / test-restore-cache (true, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test-cache / test-restore-cache (true, ubuntu-latest) (push) Blocked by required conditions
test-cache / test-restore-cache-requirements-txt (push) Blocked by required conditions
test-cache / test-setup-cache-local (push) Waiting to run
test-cache / test-restore-cache-local (push) Blocked by required conditions
test-cache / test-tilde-expansion-cache-local-path (push) Waiting to run
test-cache / test-tilde-expansion-cache-dependency-glob (push) Waiting to run
test-cache / cleanup-tilde-expansion-tests (push) Blocked by required conditions
test-windows / test-default-version (push) Waiting to run
test / test-default-version (macos-14) (push) Waiting to run
test / test-default-version (macos-latest) (push) Waiting to run
test / test-checksum (a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218, macos-latest) (push) Waiting to run
test / test-tool-install (macos-14) (push) Waiting to run
test / test-tool-install (macos-latest) (push) Waiting to run
test / test-tool-install (windows-latest) (push) Waiting to run
test / test-tilde-expansion-tool-dirs (push) Waiting to run
CodeQL / Analyze (TypeScript) (push) Failing after 35s
Release Drafter / ✏️ Draft release (push) Failing after 17s
test-cache / test-setup-cache (auto, ubuntu-latest) (push) Failing after 16s
Check dist/ / check-dist (push) Successful in 1m30s
test-cache / test-setup-cache (false, ubuntu-latest) (push) Failing after 21s
test-cache / test-setup-cache (true, ubuntu-latest) (push) Failing after 14s
test-cache / test-setup-cache-requirements-txt (push) Failing after 15s
test-cache / test-setup-cache-dependency-glob (push) Failing after 20s
test-cache / test-restore-cache-dependency-glob (push) Has been skipped
test-cache / test-no-python-version (push) Failing after 29s
test / test-default-version (ubuntu-latest) (push) Failing after 33s
test / test-specific-version (0.3) (push) Failing after 30s
test / build (push) Successful in 1m39s
test / test-specific-version (0.3.0) (push) Successful in 58s
test / test-specific-version (0.3.2) (push) Successful in 49s
test / test-specific-version (>=0.3.0) (push) Failing after 13s
test / test-specific-version (0.3.x) (push) Failing after 40s
test / test-semver-range (push) Failing after 15s
test / test-uv-file-version (push) Successful in 29s
test / test-pyproject-file-version (push) Successful in 45s
test / test-with-explicit-token (push) Failing after 37s
test / test-checksum (4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd, ubuntu-latest) (push) Successful in 51s
test / test-uvx (push) Failing after 25s
test / test-tool-install (ubuntu-latest) (push) Failing after 33s
test / test-python-version (macos-latest) (push) Failing after 24s
test / test-python-version (ubuntu-latest) (push) Failing after 31s
test / test-python-version (windows-latest) (push) Failing after 33s
Bump typescript from 5.7.2 to 5.7.3 (#230)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.2
to 5.7.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/microsoft/TypeScript/releases">typescript's
releases</a>.</em></p>
<blockquote>
<h2>TypeScript 5.7.3</h2>
<p>For release notes, check out the <a
href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/">release
announcement</a>.</p>
<ul>
<li><a
href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.7.0%22+is%3Aclosed+">fixed
issues query for Typescript 5.7.0 (Beta)</a>.</li>
<li><a
href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.7.1%22+is%3Aclosed+">fixed
issues query for Typescript 5.7.1 (RC)</a>.</li>
<li><a
href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.7.2%22+is%3Aclosed+">fixed
issues query for Typescript 5.7.2 (Stable)</a>.</li>
<li><a
href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.7.2%22+is%3Aclosed+">fixed
issues query for Typescript 5.7.3 (Stable)</a>.</li>
</ul>
<p>Downloads are available on <a
href="https://www.npmjs.com/package/typescript">npm</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a5e123d9e0"><code>a5e123d</code></a>
Update LKG</li>
<li><a
href="8bc02048a2"><code>8bc0204</code></a>
🤖 Pick PR <a
href="https://redirect.github.com/microsoft/TypeScript/issues/60828">#60828</a>
(Fix CodeQL configuration, releases) into release-5.7 (<a
href="https://redirect.github.com/microsoft/TypeScript/issues/60923">#60923</a>)</li>
<li><a
href="7aa63df74c"><code>7aa63df</code></a>
🤖 Pick PR <a
href="https://redirect.github.com/microsoft/TypeScript/issues/60393">#60393</a>
(Don't try to add an implicit undefi...) into release-5.7 (#...</li>
<li><a
href="9df7c36aa9"><code>9df7c36</code></a>
Bump version to 5.7.3 and LKG</li>
<li><a
href="e167412fe0"><code>e167412</code></a>
🤖 Pick PR <a
href="https://redirect.github.com/microsoft/TypeScript/issues/60794">#60794</a>
(Harden <code>sanitizeLog</code> against incorr...) into release-5.7
(#...</li>
<li><a
href="9ba364c55a"><code>9ba364c</code></a>
Fix coverage build on release-5.7 (<a
href="https://redirect.github.com/microsoft/TypeScript/issues/60792">#60792</a>)</li>
<li><a
href="4b7441a8be"><code>4b7441a</code></a>
🤖 Pick PR <a
href="https://redirect.github.com/microsoft/TypeScript/issues/60680">#60680</a>
(Mark the inherited any-based index ...) into release-5.7 (#...</li>
<li><a
href="e844dc305e"><code>e844dc3</code></a>
Cherry-pick <a
href="https://redirect.github.com/microsoft/TypeScript/issues/60402">#60402</a>,
<a
href="https://redirect.github.com/microsoft/TypeScript/issues/60440">#60440</a>,
<a
href="https://redirect.github.com/microsoft/TypeScript/issues/60616">#60616</a>
into release-5.7 (<a
href="https://redirect.github.com/microsoft/TypeScript/issues/60777">#60777</a>)</li>
<li><a
href="21b02a1e1f"><code>21b02a1</code></a>
🤖 Pick PR <a
href="https://redirect.github.com/microsoft/TypeScript/issues/60749">#60749</a>
(Do not require import attribute on ...) into release-5.7 (#...</li>
<li><a
href="b82fd16484"><code>b82fd16</code></a>
🤖 Pick PR <a
href="https://redirect.github.com/microsoft/TypeScript/issues/60576">#60576</a>
(Avoid incorrectly reusing assertion...) into release-5.7 (#...</li>
<li>Additional commits viewable in <a
href="https://github.com/microsoft/TypeScript/compare/v5.7.2...v5.7.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=typescript&package-manager=npm_and_yarn&previous-version=5.7.2&new-version=5.7.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-15 17:00:44 +01:00
2024-09-05 08:06:45 -04:00
2024-09-05 08:06:45 -04:00
2024-09-16 13:05:47 +00:00
2024-08-23 23:58:26 +02:00
2024-09-05 08:06:45 -04:00
2024-08-23 23:58:26 +02:00

setup-uv

Set up your GitHub Actions workflow with a specific version of uv.

  • Install a version of uv and add it to PATH
  • 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

Contents

Usage

Install a required-version or latest (default)

- name: Install the latest version of uv
  uses: astral-sh/setup-uv@v5

If you do not specify a version, this action will look for a required-version in a uv.toml or pyproject.toml file in the repository root. If none is found, the latest version will be installed.

For an example workflow, see here.

Install the latest version

- name: Install the latest version of uv
  uses: astral-sh/setup-uv@v5
  with:
    version: "latest"

Install a specific version

- name: Install a specific version of uv
  uses: astral-sh/setup-uv@v5
  with:
    version: "0.4.4"

Install a version by supplying a semver range

You can specify a semver range to install the latest version that satisfies the range.

- name: Install a semver range of uv
  uses: astral-sh/setup-uv@v5
  with:
    version: ">=0.4.0"
- name: Pinning a minor version of uv
  uses: astral-sh/setup-uv@v5
  with:
    version: "0.4.x"

Install a required-version

You can specify a required-version in either a uv.toml or pyproject.toml file:

- name: Install required-version defined in uv.toml
  uses: astral-sh/setup-uv@v5
  with:
    uv-file: "path/to/uv.toml"
- name: Install required-version defined in pyproject.toml
  uses: astral-sh/setup-uv@v5
  with:
    pyproject-file: "path/to/pyproject.toml"

Python version

You can use the input python-version to

  • set the environment variable UV_PYTHON for the rest of your workflow
  • create a new virtual environment with the specified python version
  • activate the virtual environment for the rest of your workflow

This will override any python version specifications in pyproject.toml and .python-version

- name: Install the latest version of uv and set the python version to 3.13t
  uses: astral-sh/setup-uv@v5
  with:
    python-version: 3.13t
- run: uv pip install --python=3.13t pip

You can combine this with a matrix to test multiple python versions:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12"]
    steps:
      - uses: actions/checkout@v4
      - name: Install the latest version of uv and set the python version
        uses: astral-sh/setup-uv@v5
        with:
          python-version: ${{ matrix.python-version }}
      - name: Test with python ${{ matrix.python-version }}
        run: uv run --frozen pytest

Validate checksum

You can specify a checksum to validate the downloaded executable. Checksums up to the default version are automatically verified by this action. The sha256 hashes can be found on the releases page of the uv repo.

- name: Install a specific version and validate the checksum
  uses: astral-sh/setup-uv@v5
  with:
    version: "0.3.1"
    checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"

Enable caching

If you enable caching, the uv cache will be uploaded to the GitHub Actions cache. This can speed up runs that reuse the cache by several minutes.

Tip

On self-hosted runners this is usually not needed since the cache generated by uv on the runner's filesystem is not removed after a run. For more details see Local cache path.

You can optionally define a custom cache key suffix.

- name: Enable caching and define a custom cache key suffix
  id: setup-uv
  uses: astral-sh/setup-uv@v5
  with:
    enable-cache: true
    cache-suffix: "optional-suffix"

When the cache was successfully restored, the output cache-hit will be set to true and you can use it in subsequent steps. For example, to use the cache in the above case:

- name: Do something if the cache was restored
  if: steps.setup-uv.outputs.cache-hit == 'true'
  run: echo "Cache was restored"

Cache dependency glob

If you want to control when the GitHub Actions cache is invalidated, specify a glob pattern with the cache-dependency-glob input. The GitHub Actions cache will be invalidated if any file matching the glob pattern changes. If you use relative paths, they are relative to the repository root.

Note

The default is

cache-dependency-glob: |
  **/requirements*.txt
  **/uv.lock
- name: Define a cache dependency glob
  uses: astral-sh/setup-uv@v5
  with:
    enable-cache: true
    cache-dependency-glob: "**/pyproject.toml"
- name: Define a list of cache dependency globs
  uses: astral-sh/setup-uv@v5
  with:
    enable-cache: true
    cache-dependency-glob: |
      **/requirements*.txt
      **/pyproject.toml
- name: Define an absolute cache dependency glob
  uses: astral-sh/setup-uv@v5
  with:
    enable-cache: true
    cache-dependency-glob: "/tmp/my-folder/requirements*.txt"
- name: Never invalidate the cache
  uses: astral-sh/setup-uv@v5
  with:
    enable-cache: true
    cache-dependency-glob: ""

Local cache path

This action controls where uv stores its cache on the runner's filesystem by setting UV_CACHE_DIR. It defaults to setup-uv-cache in the TMP dir, D:\a\_temp\uv-tool-dir on Windows and /tmp/setup-uv-cache on Linux/macOS. You can change the default by specifying the path with the cache-local-path input.

- name: Define a custom uv cache path
  uses: astral-sh/setup-uv@v5
  with:
    cache-local-path: "/path/to/cache"

Disable cache pruning

By default, the uv cache is pruned after every run, removing pre-built wheels, but retaining any wheels that were built from source. On GitHub-hosted runners, it's typically faster to omit those pre-built wheels from the cache (and instead re-download them from the registry on each run). However, on self-hosted or local runners, preserving the cache may be more efficient. See the documentation for more information.

If you want to persist the entire cache across runs, disable cache pruning with the prune-cache input.

- name: Don't prune the cache before saving it
  uses: astral-sh/setup-uv@v5
  with:
    enable-cache: true
    prune-cache: false

Ignore nothing to cache

By default, the action will fail if caching is enabled but there is nothing to upload (the uv cache directory does not exist). If you want to ignore this, set the ignore-nothing-to-cache input to true.

- name: Ignore nothing to cache
  uses: astral-sh/setup-uv@v5
  with:
    enable-cache: true
    ignore-nothing-to-cache: true

GitHub authentication token

This action uses the GitHub API to fetch the uv release artifacts. To avoid hitting the GitHub API rate limit too quickly, an authentication token can be provided via the github-token input. By default, the GITHUB_TOKEN secret is used, which is automatically provided by GitHub Actions.

If the default permissions for the GitHub token are not sufficient, you can provide a custom GitHub token with the necessary permissions.

- name: Install the latest version of uv with a custom GitHub token
  uses: astral-sh/setup-uv@v5
  with:
    github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

UV_TOOL_DIR

On Windows UV_TOOL_DIR is set to uv-tool-dir in the TMP dir (e.g. D:\a\_temp\uv-tool-dir). On GitHub hosted runners this is on the much faster D: drive.

On all other platforms the tool environments are placed in the default location.

If you want to change this behaviour (especially on self-hosted runners) you can use the tool-dir input:

- name: Install the latest version of uv with a custom tool dir
  uses: astral-sh/setup-uv@v5
  with:
    tool-dir: "/path/to/tool/dir"

UV_TOOL_BIN_DIR

On Windows UV_TOOL_BIN_DIR is set to uv-tool-bin-dir in the TMP dir (e.g. D:\a\_temp\uv-tool-bin-dir). On GitHub hosted runners this is on the much faster D: drive. This path is also automatically added to the PATH.

On all other platforms the tool binaries get installed to the default location.

If you want to change this behaviour (especially on self-hosted runners) you can use the tool-bin-dir input:

- name: Install the latest version of uv with a custom tool bin dir
  uses: astral-sh/setup-uv@v5
  with:
    tool-bin-dir: "/path/to/tool-bin/dir"

Tilde Expansion

This action supports expanding the ~ character to the user's home directory for the following inputs:

  • cache-local-path
  • tool-dir
  • tool-bin-dir
  • cache-dependency-glob
- name: Expand the tilde character
  uses: astral-sh/setup-uv@v5
  with:
    cache-local-path: "~/path/to/cache"
    tool-dir: "~/path/to/tool/dir"
    tool-bin-dir: "~/path/to/tool-bin/dir"
    cache-dependency-glob: "~/my-cache-buster"

How it works

This action downloads uv from the uv repo's official GitHub Releases and uses the GitHub Actions Toolkit to cache it as a tool to speed up consecutive runs on self-hosted runners.

The installed version of uv is then added to the runner PATH, enabling subsequent steps to invoke it by name (uv).

FAQ

Do I still need actions/setup-python alongside setup-uv?

With setup-uv, you can install a specific version of Python using uv python install rather than relying on actions/setup-python.

Using actions/setup-python can be faster, because GitHub caches the Python versions alongside the runner.

For example:

- name: Checkout the repository
  uses: actions/checkout@main
- name: Install the latest version of uv
  uses: astral-sh/setup-uv@v5
  with:
    enable-cache: true
- name: Test
  run: uv run --frozen pytest  # Uses the Python version automatically installed by uv

To install a specific version of Python, use uv python install:

- name: Install the latest version of uv
  uses: astral-sh/setup-uv@v5
  with:
    enable-cache: true
- name: Install Python 3.12
  run: uv python install 3.12

What is the default version?

By default, this action installs the latest version of uv.

If you require the installed version in subsequent steps of your workflow, use the uv-version output:

- name: Checkout the repository
  uses: actions/checkout@main
- name: Install the default version of uv
  id: setup-uv
  uses: astral-sh/setup-uv@v5
- name: Print the installed version
  run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"

Acknowledgements

setup-uv was initially written and published by Kevin Stillhammer before moving under the official Astral GitHub organization. You can support Kevin's work in open source on Buy me a coffee or PayPal.

License

MIT

Description
Set up your GitHub Actions workflow with a specific version of https://docs.astral.sh/uv/
Readme MIT 30 MiB
Languages
TypeScript 99.8%
Python 0.1%