Make sure uv installed by setup-uv is first in PATH

This commit is contained in:
Kevin Stillhammer 2025-04-16 12:05:09 +02:00
parent 594f292eef
commit e59aee7337
No known key found for this signature in database
3 changed files with 18 additions and 12 deletions

View file

@ -66,7 +66,10 @@ jobs:
working-directory: __tests__/fixtures/uv-project
test-semver-range:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-latest, selfhosted-ubuntu-arm64 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install version 0.3
@ -75,6 +78,12 @@ jobs:
with:
version: "0.3"
- name: Correct version gets installed
run: |
if [ "$(uv --version)" != "uv 0.3.5" ]; then
echo "Wrong uv version: $(uv --version)"
exit 1
fi
- name: Output has correct version
run: |
if [ "$UV_VERSION" != "0.3.5" ]; then
exit 1
@ -93,11 +102,10 @@ jobs:
version: ">=0.4.25,<0.5"
- name: Correct version gets installed
run: |
if [ "$UV_VERSION" != "0.4.30" ]; then
if [ "$(uv --version)" != "uv 0.4.30" ]; then
echo "Wrong uv version: $(uv --version)"
exit 1
fi
env:
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
test-pyproject-file-version:
runs-on: ubuntu-latest
@ -110,11 +118,10 @@ jobs:
pyproject-file: "__tests__/fixtures/pyproject-toml-project/pyproject.toml"
- name: Correct version gets installed
run: |
if [ "$UV_VERSION" != "0.5.14" ]; then
if [ "$(uv --version)" != "uv 0.5.14" ]; then
echo "Wrong uv version: $(uv --version)"
exit 1
fi
env:
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
test-malformed-pyproject-file-fallback:
runs-on: ubuntu-latest
@ -140,11 +147,10 @@ jobs:
uv-file: "__tests__/fixtures/uv-toml-project/uv.toml"
- name: Correct version gets installed
run: |
if [ "$UV_VERSION" != "0.5.15" ]; then
if [ "$(uv --version)" != "uv 0.5.15" ]; then
echo "Wrong uv version: $(uv --version)"
exit 1
fi
env:
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
test-checksum:
runs-on: ${{ matrix.inputs.os }}

2
dist/setup/index.js generated vendored
View file

@ -124294,8 +124294,8 @@ async function run() {
throw new Error(`Unsupported architecture: ${process.arch}`);
}
const setupResult = await setupUv(platform, arch, inputs_1.checkSum, inputs_1.githubToken);
addUvToPathAndOutput(setupResult.uvDir);
addToolBinToPath();
addUvToPathAndOutput(setupResult.uvDir);
setToolDir();
await setupPython();
addMatchers();

View file

@ -44,8 +44,8 @@ async function run(): Promise<void> {
}
const setupResult = await setupUv(platform, arch, checkSum, githubToken);
addUvToPathAndOutput(setupResult.uvDir);
addToolBinToPath();
addUvToPathAndOutput(setupResult.uvDir);
setToolDir();
await setupPython();
addMatchers();