From e59aee7337afdbd8369cc01b080a060039534103 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Wed, 16 Apr 2025 12:05:09 +0200 Subject: [PATCH] Make sure uv installed by setup-uv is first in PATH --- .github/workflows/test.yml | 26 ++++++++++++++++---------- dist/setup/index.js | 2 +- src/setup-uv.ts | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 025c9fd..5a9c0a2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 }} diff --git a/dist/setup/index.js b/dist/setup/index.js index fab8add..ebd1bfc 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -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(); diff --git a/src/setup-uv.ts b/src/setup-uv.ts index ee7e77c..beed547 100644 --- a/src/setup-uv.ts +++ b/src/setup-uv.ts @@ -44,8 +44,8 @@ async function run(): Promise { } const setupResult = await setupUv(platform, arch, checkSum, githubToken); - addUvToPathAndOutput(setupResult.uvDir); addToolBinToPath(); + addUvToPathAndOutput(setupResult.uvDir); setToolDir(); await setupPython(); addMatchers();