mirror of
https://gitcode.com/gh_mirrors/se/setup-uv.git
synced 2026-07-03 18:45:08 +00:00
fc16fa3bbf
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 7.0.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v7.0.0</h2> <h2>What's Changed</h2> <ul> <li>block checking out fork pr for pull_request_target and workflow_run by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> <li>Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2458">actions/checkout#2458</a></li> <li>Bump flatted from 3.3.1 to 3.4.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2460">actions/checkout#2460</a></li> <li>Bump js-yaml from 4.1.0 to 4.2.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2461">actions/checkout#2461</a></li> <li>Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2459">actions/checkout#2459</a></li> <li>upgrade module to esm and update dependencies by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2463">actions/checkout#2463</a></li> <li>Bump the minor-npm-dependencies group across 1 directory with 3 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2462">actions/checkout#2462</a></li> <li>getting ready for checkout v7 release by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2464">actions/checkout#2464</a></li> <li>update error wording by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2467">actions/checkout#2467</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6.0.3...v7.0.0">https://github.com/actions/checkout/compare/v6.0.3...v7.0.0</a></p> <h2>v6.0.3</h2> <h2>What's Changed</h2> <ul> <li>Update changelog by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2357">actions/checkout#2357</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>Update changelog for v6.0.3 by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2446">actions/checkout#2446</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/yaananth"><code>@yaananth</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6...v6.0.3">https://github.com/actions/checkout/compare/v6...v6.0.3</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v7.0.0</h2> <ul> <li>Block checking out fork PR for pull_request_target and workflow_run by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> <li>Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2458">actions/checkout#2458</a></li> <li>Bump flatted from 3.3.1 to 3.4.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2460">actions/checkout#2460</a></li> <li>Bump js-yaml from 4.1.0 to 4.2.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2461">actions/checkout#2461</a></li> <li>Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2459">actions/checkout#2459</a></li> <li>upgrade module to esm and update dependencies by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2463">actions/checkout#2463</a></li> <li>Bump the minor-npm-dependencies group across 1 directory with 3 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2462">actions/checkout#2462</a></li> </ul> <h2>v6.0.3</h2> <ul> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <h2>v6.0.2</h2> <ul> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <h2>v6.0.1</h2> <ul> <li>Add worktree support for persist-credentials includeIf by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li> </ul> <h2>v6.0.0</h2> <ul> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> </ul> <h2>v5.0.1</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <h2>v5.0.0</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> </ul> <h2>v4.3.1</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <h2>v4.3.0</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> <li>Adjust positioning of user email note and permissions heading by <a href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li> <li>Update README.md by <a href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li> <li>Update CODEOWNERS for actions by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li> <li>Update package dependencies by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li> </ul> <h2>v4.2.2</h2> <ul> <li><code>url-helper.ts</code> now leverages well-known environment variables by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li> <li>Expand unit test coverage for <code>isGhes</code> by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li> </ul> <h2>v4.2.1</h2> <ul> <li>Check out other refs/* by commit if provided, fall back to ref by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/checkout/commit/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0"><code>9c091bb</code></a> update error wording (<a href="https://redirect.github.com/actions/checkout/issues/2467">#2467</a>)</li> <li><a href="https://github.com/actions/checkout/commit/1044a6dea927916f2c38ba5aeffbc0a847b1221a"><code>1044a6d</code></a> getting ready for checkout v7 release (<a href="https://redirect.github.com/actions/checkout/issues/2464">#2464</a>)</li> <li><a href="https://github.com/actions/checkout/commit/f0282184c7ce73ab54c7e4ab5a617122602e575f"><code>f028218</code></a> Bump the minor-npm-dependencies group across 1 directory with 3 updates (<a href="https://redirect.github.com/actions/checkout/issues/2462">#2462</a>)</li> <li><a href="https://github.com/actions/checkout/commit/d914b262ffc244530a203ab40decab34c3abf34d"><code>d914b26</code></a> upgrade module to esm and update dependencies (<a href="https://redirect.github.com/actions/checkout/issues/2463">#2463</a>)</li> <li><a href="https://github.com/actions/checkout/commit/537c7ef99cef6e5ddb5e7ff5d16d14510503801d"><code>537c7ef</code></a> Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid (<a href="https://redirect.github.com/actions/checkout/issues/2459">#2459</a>)</li> <li><a href="https://github.com/actions/checkout/commit/130a169078a413d3a5246a393625e8e742f387f6"><code>130a169</code></a> Bump js-yaml from 4.1.0 to 4.2.0 (<a href="https://redirect.github.com/actions/checkout/issues/2461">#2461</a>)</li> <li><a href="https://github.com/actions/checkout/commit/7d09575332117a40b46e5e020664df234cd416f3"><code>7d09575</code></a> Bump flatted from 3.3.1 to 3.4.2 (<a href="https://redirect.github.com/actions/checkout/issues/2460">#2460</a>)</li> <li><a href="https://github.com/actions/checkout/commit/0f9f3aa320cb53abeb534aeb54048075d9697a0e"><code>0f9f3aa</code></a> Bump actions/publish-immutable-action (<a href="https://redirect.github.com/actions/checkout/issues/2458">#2458</a>)</li> <li><a href="https://github.com/actions/checkout/commit/f9e715a95fcd1f9253f77dd28f11e88d2d6460c7"><code>f9e715a</code></a> block checking out fork pr for pull_request_target and workflow_run (<a href="https://redirect.github.com/actions/checkout/issues/2454">#2454</a>)</li> <li><a href="https://github.com/actions/checkout/commit/df4cb1c069e1874edd31b4311f1884172cec0e10"><code>df4cb1c</code></a> Update changelog for v6.0.3 (<a href="https://redirect.github.com/actions/checkout/issues/2446">#2446</a>)</li> <li>Additional commits viewable in <a href="https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0">compare view</a></li> </ul> </details> <br /> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1154 lines
38 KiB
YAML
1154 lines
38 KiB
YAML
name: "test"
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
security-events: write # for zizmor
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Actionlint
|
|
uses: eifinger/actionlint-action@1fc89649be682d16ec5cf65ea16e269eb88d3982 # v1.10.2
|
|
- name: Run zizmor
|
|
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: npm
|
|
- run: |
|
|
npm ci --ignore-scripts
|
|
- run: |
|
|
npm run all
|
|
- name: Check all jobs are in all-tests-passed.needs
|
|
run: |
|
|
tsc -p tsconfig.json
|
|
node check-all-tests-passed-needs.js
|
|
working-directory: .github/scripts
|
|
- name: Make sure no changes from linters are detected
|
|
run: |
|
|
git diff --exit-code || (echo "::error::Please run 'npm run all' to fix the issues" && exit 1)
|
|
|
|
test-default-version:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install latest version
|
|
id: setup-uv
|
|
uses: ./
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
shell: bash
|
|
- name: Check uv-path is set
|
|
run: |
|
|
"${UV_PATH}" --version
|
|
shell: bash
|
|
env:
|
|
UV_PATH: ${{ steps.setup-uv.outputs.uv-path }}
|
|
- name: Check uvx-path is set
|
|
run: |
|
|
"${UVX_PATH}" --version
|
|
shell: bash
|
|
env:
|
|
UVX_PATH: ${{ steps.setup-uv.outputs.uvx-path }}
|
|
|
|
test-uv-no-modify-path:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install with UV_NO_MODIFY_PATH set
|
|
id: setup-uv
|
|
uses: ./
|
|
env:
|
|
UV_NO_MODIFY_PATH: 1
|
|
- run: |
|
|
"${UV_PATH}" sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
shell: bash
|
|
env:
|
|
UV_PATH: ${{ steps.setup-uv.outputs.uv-path }}
|
|
- name: uv is not on PATH
|
|
run: |
|
|
if command -v uv; then
|
|
echo "uv should not be on PATH"
|
|
exit 1
|
|
fi
|
|
|
|
test-specific-version:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
input:
|
|
- version-input: "0.3.0"
|
|
expected-version: "0.3.0"
|
|
- version-input: "0.3.2"
|
|
expected-version: "0.3.2"
|
|
- version-input: "0.3"
|
|
expected-version: "0.3.5"
|
|
- version-input: "0.3.x"
|
|
expected-version: "0.3.5"
|
|
- version-input: ">=0.4.25,<0.5"
|
|
expected-version: "0.4.30"
|
|
- version-input: ">=0.4.25,<0.5"
|
|
expected-version: "0.4.25"
|
|
resolution-strategy: "lowest"
|
|
- version-input: ">=0.4.25"
|
|
expected-version: "0.4.25"
|
|
resolution-strategy: "lowest"
|
|
- version-input: ">=0.1,<0.2"
|
|
expected-version: "0.1.45"
|
|
resolution-strategy: "highest"
|
|
- version-input: ">=0.1.0,<0.2"
|
|
expected-version: "0.1.0"
|
|
resolution-strategy: "lowest"
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install version ${{ matrix.input.version-input }} with strategy ${{ matrix.input.resolution-strategy || 'highest' }}
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
version: ${{ matrix.input.version-input }}
|
|
resolution-strategy: ${{ matrix.input.resolution-strategy || 'highest' }}
|
|
- name: Correct version gets installed
|
|
run: |
|
|
if [ "$(uv --version)" != "uv ${{ matrix.input.expected-version }}" ]; then
|
|
echo "Wrong uv version: $(uv --version)"
|
|
exit 1
|
|
fi
|
|
- name: Output has correct version
|
|
run: |
|
|
if [ "$UV_VERSION" != "${{ matrix.input.expected-version }}" ]; then
|
|
exit 1
|
|
fi
|
|
env:
|
|
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
|
|
|
|
test-latest-version:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
version-input: ["latest", ">=0.8"]
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install version ${{ matrix.version-input }}
|
|
uses: ./
|
|
with:
|
|
version: ${{ matrix.version-input }}
|
|
- name: Latest version gets installed
|
|
run: |
|
|
LATEST_VERSION=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/astral-sh/uv/releases/latest | jq -r '.tag_name')
|
|
UV_VERSION_OUTPUT=$(uv --version)
|
|
|
|
if [[ ! "$UV_VERSION_OUTPUT" =~ ^uv[[:space:]]+([^[:space:]]+) ]]; then
|
|
echo "Could not parse uv version from: $UV_VERSION_OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
UV_VERSION="${BASH_REMATCH[1]}"
|
|
|
|
echo "Latest version is $LATEST_VERSION"
|
|
echo "uv --version output is $UV_VERSION_OUTPUT"
|
|
echo "Parsed uv version is $UV_VERSION"
|
|
|
|
if [ "$UV_VERSION" != "$LATEST_VERSION" ]; then
|
|
echo "Wrong uv version: $UV_VERSION_OUTPUT"
|
|
exit 1
|
|
fi
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
test-from-working-directory-version:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
input:
|
|
- working-directory: "__tests__/fixtures/pyproject-toml-project"
|
|
expected-version: "0.5.14"
|
|
- working-directory: "__tests__/fixtures/uv-toml-project"
|
|
expected-version: "0.5.15"
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install version from ${{ matrix.input.working-directory }}
|
|
uses: ./
|
|
with:
|
|
working-directory: ${{ matrix.input.working-directory }}
|
|
- name: Correct version gets installed
|
|
run: |
|
|
if [ "$(uv --version)" != "uv ${{ matrix.input.expected-version }}" ]; then
|
|
echo "Wrong uv version: $(uv --version)"
|
|
exit 1
|
|
fi
|
|
|
|
test-version-file-version:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
input:
|
|
- version-file: "__tests__/fixtures/uv-in-requirements-txt-project/requirements.txt"
|
|
expected-version: "0.6.17"
|
|
- version-file: "__tests__/fixtures/uv-in-requirements-hash-txt-project/requirements.txt"
|
|
expected-version: "0.8.3"
|
|
- version-file: "__tests__/fixtures/.tool-versions"
|
|
expected-version: "0.5.15"
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install version from ${{ matrix.input.version-file }}
|
|
uses: ./
|
|
with:
|
|
version-file: ${{ matrix.input.version-file }}
|
|
- name: Correct version gets installed
|
|
run: |
|
|
if [ "$(uv --version)" != "uv ${{ matrix.input.expected-version }}" ]; then
|
|
echo "Wrong uv version: $(uv --version)"
|
|
exit 1
|
|
fi
|
|
|
|
test-malformed-pyproject-file-fallback:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install using malformed pyproject.toml
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
working-directory: "__tests__/fixtures/malformed-pyproject-toml-project"
|
|
- run: uv --help
|
|
|
|
test-checksum:
|
|
runs-on: ${{ matrix.inputs.os }}
|
|
strategy:
|
|
matrix:
|
|
inputs:
|
|
- os: ubuntu-latest
|
|
checksum: "4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd"
|
|
- os: macos-latest
|
|
checksum: "a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218"
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Checksum matches expected
|
|
uses: ./
|
|
with:
|
|
version: "0.3.2"
|
|
checksum: ${{ matrix.inputs.checksum }}
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
|
|
test-with-explicit-token:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install default version
|
|
uses: ./
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
|
|
test-uvx:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install default version
|
|
uses: ./
|
|
- run: uvx ruff --version
|
|
|
|
test-tool-install:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install default version
|
|
uses: ./
|
|
- run: uv tool install ruff
|
|
- run: ruff --version
|
|
|
|
test-python-version:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install latest version
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
python-version: 3.13.1t
|
|
- name: Verify UV_PYTHON is set to correct version
|
|
run: |
|
|
echo "$UV_PYTHON"
|
|
if [ "$UV_PYTHON" != "3.13.1t" ]; then
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
- name: Verify output python-version is correct
|
|
run: |
|
|
if [ "$PYTHON_VERSION" != "3.13.1t" ]; then
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
env:
|
|
PYTHON_VERSION: ${{ steps.setup-uv.outputs.python-version }}
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
|
|
test-activate-environment:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install latest version
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
python-version: 3.13.1t
|
|
activate-environment: true
|
|
- name: Verify packages can be installed
|
|
run: uv pip install pip
|
|
shell: bash
|
|
- name: Verify python version is correct
|
|
run: |
|
|
python --version
|
|
if [ "$(python --version)" != "Python 3.13.1" ]; then
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
- name: Verify output venv is set
|
|
run: |
|
|
if [ -z "$UV_VENV" ]; then
|
|
echo "output venv is not set"
|
|
exit 1
|
|
fi
|
|
if [ ! -d "$UV_VENV" ]; then
|
|
echo "output venv not point to a directory: $UV_VENV"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
env:
|
|
UV_VENV: ${{ steps.setup-uv.outputs.venv }}
|
|
|
|
test-activate-environment-custom-path:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install latest version
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
python-version: 3.13.1t
|
|
activate-environment: true
|
|
venv-path: ${{ runner.temp }}/custom-venv
|
|
- name: Verify VIRTUAL_ENV matches output
|
|
run: |
|
|
if [ "$VIRTUAL_ENV" != "$UV_VENV" ]; then
|
|
echo "VIRTUAL_ENV does not match venv output: $VIRTUAL_ENV vs $UV_VENV"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
env:
|
|
UV_VENV: ${{ steps.setup-uv.outputs.venv }}
|
|
- name: Verify venv location is runner.temp/custom-venv
|
|
run: |
|
|
python - <<'PY'
|
|
import os
|
|
from pathlib import Path
|
|
|
|
venv = Path(os.environ["VIRTUAL_ENV"]).resolve()
|
|
temp = Path(os.environ["RUNNER_TEMP"]).resolve()
|
|
|
|
if venv.name != "custom-venv":
|
|
raise SystemExit(f"Expected venv name 'custom-venv', got: {venv}")
|
|
if venv.parent != temp:
|
|
raise SystemExit(f"Expected venv under {temp}, got: {venv}")
|
|
if not venv.is_dir():
|
|
raise SystemExit(f"Venv directory does not exist: {venv}")
|
|
PY
|
|
shell: bash
|
|
- name: Verify packages can be installed
|
|
run: uv pip install pip
|
|
shell: bash
|
|
- name: Verify python runs from custom venv
|
|
run: |
|
|
python - <<'PY'
|
|
import sys
|
|
if "custom-venv" not in sys.executable:
|
|
raise SystemExit(f"Python is not running from custom venv: {sys.executable}")
|
|
PY
|
|
shell: bash
|
|
|
|
test-activate-environment-no-project:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Create incompatible pyproject.toml
|
|
run: |
|
|
cat > pyproject.toml <<'EOF'
|
|
[project]
|
|
name = "test-no-project"
|
|
version = "0.1.0"
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"-e file:///${PROJECT_ROOT}/projects/pkg",
|
|
]
|
|
EOF
|
|
shell: bash
|
|
- name: Install latest version with no-project
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
python-version: 3.13.1t
|
|
activate-environment: true
|
|
no-project: true
|
|
- name: Verify packages can be installed
|
|
run: uv pip install pip
|
|
shell: bash
|
|
- name: Verify output venv is set
|
|
run: |
|
|
if [ -z "$UV_VENV" ]; then
|
|
echo "output venv is not set"
|
|
exit 1
|
|
fi
|
|
if [ ! -d "$UV_VENV" ]; then
|
|
echo "output venv not point to a directory: $UV_VENV"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
env:
|
|
UV_VENV: ${{ steps.setup-uv.outputs.venv }}
|
|
|
|
test-debian-unstable:
|
|
runs-on: ubuntu-latest
|
|
container: debian:unstable
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install latest version
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
|
|
test-musl:
|
|
runs-on: ubuntu-latest
|
|
container: alpine
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install latest version
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
- name: Verify cache key contains alpine
|
|
run: |
|
|
echo "Cache key: $CACHE_KEY"
|
|
if echo "$CACHE_KEY" | grep -qv "alpine"; then
|
|
echo "Cache key does not contain 'alpine'"
|
|
exit 1
|
|
fi
|
|
shell: sh
|
|
env:
|
|
CACHE_KEY: ${{ steps.setup-uv.outputs.cache-key }}
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
|
|
test-cache-key-os-version:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-22.04
|
|
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
|
|
expected-os: "windows-2022"
|
|
- os: windows-2025
|
|
expected-os: "windows-2025"
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup uv
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
- name: Verify cache key contains OS version
|
|
run: |
|
|
echo "Cache key: $CACHE_KEY"
|
|
if [[ "$CACHE_KEY" != *"${{ matrix.expected-os }}"* ]]; then
|
|
echo "Cache key does not contain expected OS version: ${{ matrix.expected-os }}"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
env:
|
|
CACHE_KEY: ${{ steps.setup-uv.outputs.cache-key }}
|
|
|
|
test-setup-cache:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
enable-cache: ["true", "false", "auto"]
|
|
os: ["ubuntu-latest", "windows-latest"]
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup with cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: ${{ matrix.enable-cache }}
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-${{ matrix.os }}-${{ matrix.enable-cache }}
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
shell: bash
|
|
test-restore-cache:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
enable-cache: ["true", "false", "auto"]
|
|
os: ["ubuntu-latest", "windows-latest"]
|
|
needs: test-setup-cache
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Restore with cache
|
|
id: restore
|
|
uses: ./
|
|
with:
|
|
enable-cache: ${{ matrix.enable-cache }}
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-${{ matrix.os }}-${{ matrix.enable-cache }}
|
|
- name: Cache was hit
|
|
if: ${{ matrix.enable-cache == 'true' || (matrix.enable-cache == 'auto' && matrix.os == 'ubuntu-latest') }}
|
|
run: |
|
|
if [ "$CACHE_HIT" != "true" ]; then
|
|
exit 1
|
|
fi
|
|
env:
|
|
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
|
|
shell: bash
|
|
- name: Cache was not hit
|
|
if: ${{ matrix.enable-cache == 'false' }}
|
|
run: |
|
|
if [ "$CACHE_HIT" == "true" ]; then
|
|
exit 1
|
|
fi
|
|
env:
|
|
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
|
|
shell: bash
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
shell: bash
|
|
|
|
test-setup-cache-requirements-txt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup with cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-requirements-txt
|
|
- run: |
|
|
uv venv
|
|
uv pip install -r requirements.txt
|
|
working-directory: __tests__/fixtures/requirements-txt-project
|
|
test-restore-cache-requirements-txt:
|
|
runs-on: ubuntu-latest
|
|
needs: test-setup-cache-requirements-txt
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Restore with cache
|
|
id: restore
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-requirements-txt
|
|
- name: Cache was hit
|
|
run: |
|
|
if [ "$CACHE_HIT" != "true" ]; then
|
|
exit 1
|
|
fi
|
|
env:
|
|
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
|
|
- run: |
|
|
uv venv
|
|
uv pip install -r requirements.txt
|
|
working-directory: __tests__/fixtures/requirements-txt-project
|
|
|
|
test-setup-cache-dependency-glob:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup with cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: |
|
|
__tests__/fixtures/uv-project/uv.lock
|
|
**/pyproject.toml
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-dependency-glob
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
test-restore-cache-dependency-glob:
|
|
runs-on: ubuntu-latest
|
|
needs: test-setup-cache-dependency-glob
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Change pyproject.toml
|
|
run: |
|
|
echo '[tool.uv]' >> __tests__/fixtures/uv-project/pyproject.toml
|
|
echo 'dev-dependencies = []' >> __tests__/fixtures/uv-project/pyproject.toml
|
|
- name: Restore with cache
|
|
id: restore
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: |
|
|
__tests__/fixtures/uv-project/uv.lock
|
|
**/pyproject.toml
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-dependency-glob
|
|
ignore-nothing-to-cache: true
|
|
- name: Cache was not hit
|
|
run: |
|
|
if [ "$CACHE_HIT" == "true" ]; then
|
|
exit 1
|
|
fi
|
|
env:
|
|
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
|
|
|
|
test-setup-cache-save-cache-false:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup with cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
save-cache: false
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-save-cache-false
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
shell: bash
|
|
test-restore-cache-save-cache-false:
|
|
runs-on: ubuntu-latest
|
|
needs: test-setup-cache-save-cache-false
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Restore with cache
|
|
id: restore
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-save-cache-false
|
|
- name: Cache was not hit
|
|
run: |
|
|
if [ "$CACHE_HIT" == "true" ]; then
|
|
exit 1
|
|
fi
|
|
env:
|
|
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
|
|
|
|
test-setup-cache-restore-cache-false:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup with cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-restore-cache-false
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
shell: bash
|
|
test-restore-cache-restore-cache-false:
|
|
runs-on: ubuntu-latest
|
|
needs: test-setup-cache-restore-cache-false
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Restore with cache
|
|
id: restore
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
restore-cache: false
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-restore-cache-false
|
|
- name: Cache was not hit
|
|
run: |
|
|
if [ "$CACHE_HIT" == "true" ]; then
|
|
exit 1
|
|
fi
|
|
env:
|
|
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
|
|
|
|
test-cache-local:
|
|
strategy:
|
|
matrix:
|
|
inputs:
|
|
- os: ubuntu-latest
|
|
expected-cache-dir: "/home/runner/work/_temp/setup-uv-cache"
|
|
- os: windows-latest
|
|
expected-cache-dir: "D:\\a\\_temp\\setup-uv-cache"
|
|
runs-on: ${{ matrix.inputs.os }}
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup with cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-local
|
|
- run: |
|
|
if [ "$UV_CACHE_DIR" != "${{ matrix.inputs.expected-cache-dir }}" ]; then
|
|
echo "UV_CACHE_DIR is not set to the expected value: $UV_CACHE_DIR"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
|
|
test-cache-local-cache-disabled:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup without cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: false
|
|
|
|
- name: Check UV_CACHE_DIR is not set
|
|
run: |
|
|
if [ -n "$UV_CACHE_DIR" ]; then
|
|
echo "UV_CACHE_DIR should not be set when cache is disabled: $UV_CACHE_DIR"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
|
|
test-cache-local-cache-disabled-but-explicit-path:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup without cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: false
|
|
cache-local-path: /tmp/uv-cache-disabled
|
|
|
|
- name: Check UV_CACHE_DIR is set
|
|
run: |
|
|
if [ "$UV_CACHE_DIR" != "/tmp/uv-cache-disabled" ]; then
|
|
echo "UV_CACHE_DIR should be set when cache is disabled but explicit path is provided"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
|
|
test-no-python-version:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Fake pyproject.toml at root
|
|
run: cp __tests__/fixtures/old-python-constraint-project/pyproject.toml pyproject.toml
|
|
- name: Setup with cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/old-python-constraint-project
|
|
|
|
test-custom-manifest-file:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install from custom manifest file
|
|
uses: ./
|
|
with:
|
|
manifest-file: "https://raw.githubusercontent.com/astral-sh/setup-uv/${{ github.ref }}/__tests__/download/custom-manifest.ndjson"
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
- name: Correct version gets installed
|
|
run: |
|
|
if [ "$(uv --version)" != "uv 0.9.26" ]; then
|
|
echo "Wrong uv version: $(uv --version)"
|
|
exit 1
|
|
fi
|
|
|
|
test-download-from-astral-mirror-false:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install with download-from-astral-mirror disabled
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
download-from-astral-mirror: false
|
|
- name: Verify uv is installed
|
|
run: uv --version
|
|
|
|
test-absolute-path:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Create requirements.txt
|
|
run: echo "uv==0.6.17" > /tmp/setup-uv-requirements.txt
|
|
- name: Install from requirements file
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
version-file: "/tmp/setup-uv-requirements.txt"
|
|
- name: Correct version gets installed
|
|
run: |
|
|
if [ "$(uv --version)" != "uv 0.6.17" ]; then
|
|
echo "Wrong uv version: $(uv --version)"
|
|
exit 1
|
|
fi
|
|
|
|
test-relative-path:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: mkdir
|
|
run: mkdir -p /tmp/setup-uv-test-relative-path
|
|
- name: Create requirements.txt
|
|
run: echo "uv==0.6.17" > /tmp/setup-uv-test-relative-path/setup-uv-requirements.txt
|
|
- name: Install from requirements file
|
|
id: setup-uv
|
|
uses: ./
|
|
with:
|
|
version-file: "./setup-uv-requirements.txt"
|
|
working-directory: "/tmp/setup-uv-test-relative-path"
|
|
cache-dependency-glob: "./setup-uv-requirements.txt"
|
|
- name: Correct version gets installed
|
|
run: |
|
|
if [ "$(uv --version)" != "uv 0.6.17" ]; then
|
|
echo "Wrong uv version: $(uv --version)"
|
|
exit 1
|
|
fi
|
|
|
|
test-cache-prune-force:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup uv
|
|
uses: ./
|
|
with:
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-prune-force
|
|
- name: Create long running python script
|
|
run: |
|
|
echo 'import time' > __tests__/fixtures/uv-project/long-running.py
|
|
echo 'time.sleep(300)' >> __tests__/fixtures/uv-project/long-running.py
|
|
- run: uv run long-running.py &
|
|
working-directory: __tests__/fixtures/uv-project
|
|
|
|
test-cache-dir-from-file:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Verify uv cache dir is not populated
|
|
run: |
|
|
if [ -f "/tmp/pyproject-toml-defined-cache-path/CACHEDIR.TAG" ]; then
|
|
echo "Cache dir should not exist"
|
|
exit 1
|
|
fi
|
|
- name: Setup uv
|
|
uses: ./
|
|
with:
|
|
working-directory: __tests__/fixtures/cache-dir-defined-project
|
|
- run: uv sync
|
|
working-directory: __tests__/fixtures/cache-dir-defined-project
|
|
- name: Verify uv cache dir is populated
|
|
run: |
|
|
if [ ! -f "/tmp/pyproject-toml-defined-cache-path/CACHEDIR.TAG" ]; then
|
|
echo "Cache dir should exist"
|
|
exit 1
|
|
fi
|
|
|
|
test-cache-python-missing-managed-install-dir:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
UV_PYTHON_INSTALL_DIR: /tmp/missing-uv-python
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup uv with cache and python cache enabled
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
cache-python: true
|
|
python-version: "3.12"
|
|
cache-local-path: /tmp/setup-uv-cache
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-python-missing-managed-install-dir
|
|
- name: Ensure uv cache dir exists so only python-cache behavior is tested
|
|
run: uv sync
|
|
working-directory: __tests__/fixtures/uv-project
|
|
shell: bash
|
|
- name: Ensure managed Python install dir does not exist and this does not break caching
|
|
run: rm -rf "$UV_PYTHON_INSTALL_DIR"
|
|
|
|
test-cache-python-installs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Verify Python install dir is not populated
|
|
run: |
|
|
if [ -d /home/runner/work/_temp/uv-python-dir ]; then
|
|
echo "Python install dir should not exist"
|
|
exit 1
|
|
fi
|
|
- name: Setup uv with cache
|
|
uses: ./
|
|
with:
|
|
enable-cache: true
|
|
cache-python: true
|
|
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-python-installs
|
|
- run: uv sync --managed-python
|
|
working-directory: __tests__/fixtures/uv-project
|
|
- 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
|
|
test-restore-python-installs:
|
|
runs-on: ubuntu-latest
|
|
needs: test-cache-python-installs
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Verify Python install dir does not exist
|
|
run: |
|
|
if [ -d /home/runner/work/_temp/uv-python-dir ]; then
|
|
echo "Python install dir should not exist"
|
|
exit 1
|
|
fi
|
|
- name: Restore with cache
|
|
id: restore
|
|
uses: ./
|
|
with:
|
|
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
|
|
env:
|
|
CACHE_HIT: ${{ steps.restore.outputs.python-cache-hit }}
|
|
- run: uv sync --managed-python
|
|
working-directory: __tests__/fixtures/uv-project
|
|
|
|
test-python-install-dir:
|
|
strategy:
|
|
matrix:
|
|
inputs:
|
|
- os: ubuntu-latest
|
|
expected-python-dir: "/home/runner/work/_temp/uv-python-dir"
|
|
- os: windows-latest
|
|
expected-python-dir: "D:\\a\\_temp\\uv-python-dir"
|
|
runs-on: ${{ matrix.inputs.os }}
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install latest version
|
|
id: setup-uv
|
|
uses: ./
|
|
- name: Check Python dir is expected dir
|
|
run: |
|
|
if [ "$UV_PYTHON_INSTALL_DIR" != "${{ matrix.inputs.expected-python-dir }}" ]; then
|
|
echo "Wrong UV_PYTHON_INSTALL_DIR: UV_PYTHON_INSTALL_DIR"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
- name: Install python works
|
|
run: uv python install
|
|
|
|
test-act:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install act
|
|
run: gh extension install https://github.com/nektos/gh-act
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
- name: Run test-uvx with act
|
|
run: gh act -j test-uvx -P ubuntu-latest=catthehacker/ubuntu:act-latest
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
validate-typings:
|
|
runs-on: "ubuntu-latest"
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Validate typings
|
|
uses: typesafegithub/github-actions-typing@9ddf35b71a482be7d8922b28e8d00df16b77e315 # v2.2.2
|
|
|
|
all-tests-passed:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- lint
|
|
- test-default-version
|
|
- test-uv-no-modify-path
|
|
- test-specific-version
|
|
- test-latest-version
|
|
- test-from-working-directory-version
|
|
- test-malformed-pyproject-file-fallback
|
|
- test-version-file-version
|
|
- test-checksum
|
|
- test-with-explicit-token
|
|
- test-uvx
|
|
- test-tool-install
|
|
- test-python-version
|
|
- test-activate-environment
|
|
- test-activate-environment-custom-path
|
|
- test-activate-environment-no-project
|
|
- test-debian-unstable
|
|
- test-musl
|
|
- test-cache-key-os-version
|
|
- test-cache-local
|
|
- test-cache-local-cache-disabled
|
|
- test-cache-local-cache-disabled-but-explicit-path
|
|
- test-setup-cache
|
|
- test-restore-cache
|
|
- test-setup-cache-requirements-txt
|
|
- test-restore-cache-requirements-txt
|
|
- test-setup-cache-dependency-glob
|
|
- test-restore-cache-dependency-glob
|
|
- test-setup-cache-save-cache-false
|
|
- test-restore-cache-save-cache-false
|
|
- test-setup-cache-restore-cache-false
|
|
- test-restore-cache-restore-cache-false
|
|
- test-no-python-version
|
|
- test-custom-manifest-file
|
|
- test-download-from-astral-mirror-false
|
|
- test-absolute-path
|
|
- test-relative-path
|
|
- test-cache-prune-force
|
|
- test-cache-dir-from-file
|
|
- test-cache-python-missing-managed-install-dir
|
|
- test-cache-python-installs
|
|
- test-restore-python-installs
|
|
- test-python-install-dir
|
|
- test-act
|
|
- validate-typings
|
|
if: always()
|
|
steps:
|
|
- name: All tests passed
|
|
run: |
|
|
echo "All jobs passed: ${{ !(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}"
|
|
# shellcheck disable=SC2242
|
|
exit ${{ (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) && 1 || 0 }}
|