Skip to content

Use setup-uv in Release test container job - #183

Merged
ppenna merged 2 commits into
devfrom
copilot/fix-uv-installation-test-job
May 14, 2026
Merged

Use setup-uv in Release test container job#183
ppenna merged 2 commits into
devfrom
copilot/fix-uv-installation-test-job

Conversation

Copilot AI commented May 14, 2026

Copy link
Copy Markdown
Contributor

The Release workflow’s Linux test job failed before dependency sync because the shell-based uv installer was not reliable in the containerized environment. This change aligns that job with the workflow’s existing uv setup pattern so uv is available to subsequent steps.

  • What changed

    • Replaced the test job’s manual curl ... | sh install path with astral-sh/setup-uv@v7.
    • Set python-version: "3.12" in that step, matching the other jobs in release.yml.
  • Workflow consistency

    • The test job now uses the same official uv installation action already used in lint-and-typecheck, test-windows, and release.
- name: Install uv
  uses: astral-sh/setup-uv@v7
  with:
    python-version: "3.12"
Original prompt

The GitHub Actions workflow has a failing job in the Release workflow.

Repository: nanvix/zutils
Workflow file: .github/workflows/release.yml
Failing job URL: https://github.com/nanvix/zutils/actions/runs/25878918232/job/76053939367

Observed failure:

  • In the test job, the manual shell-based uv installation does not make uv available to subsequent steps.
  • The log shows: /__w/_temp/98215ee3-a711-4bb9-9f04-e62600b1cbf3.sh: 1: uv: not found
  • The failure happens before uv sync --python 3.12.

Requested fix:

  • Update .github/workflows/release.yml so the containerized test job installs uv in a reliable way.
  • Prefer using the same official action already used elsewhere in the workflow (astral-sh/setup-uv@v7) instead of the current manual installer.
  • Keep the fix minimal and scoped to the workflow.

Acceptance criteria:

  • The test job no longer relies on curl ... | sh for uv installation.
  • The test job uses astral-sh/setup-uv@v7 consistently with the other jobs in this workflow.
  • Subsequent steps in the test job can invoke uv successfully.
  • Open a pull request with the fix.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: The failure is in the test job’s Install project and dev dependencies path, and the root cause is earlier:

Why it failed

In the containerized test job, uv is installed with:

- name: Install uv
  run: |
    curl -LsSf https://astral.sh/uv/install.sh | sh
    echo "$HOME/.local/bin" >> "$GITHUB_PATH"

This assumes:

  1. the installer places uv in $HOME/.local/bin, and
  2. $GITHUB_PATH updates PATH correctly in this container environment.

But the next step cannot find uv, so that path update is not taking effect as expected for the job container.

Fix

Use the official setup-uv action in the Linux test job too, instead of manually installing uv inside the container.

Recommended change

Replace lines 55–59 with:

      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          python-version: "3.12"

So the test job becomes:

  test:
    name: Tests
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/nanvix/toolchain-gcc@sha256:ea33e4cae4041dcf55f0ec49f58de90ae1b5e9fb7c3c507971b40975b14aecd3
    env:
      NANVIX_TOOLCHAIN: /opt/nanvix
      USER: runner
    steps:
      - uses: actions/checkout@v6

      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          python-version: "3.12"

      - name: Install project and dev dependencies
        run: uv sync --python 3.12

      - name: Run tests
        run: uv run pytest tests/ -v

If you want to keep the shell installer

Make the installed binary available immediately in the same shell and for later steps:

      - name: Install uv
        run: |
          curl -LsSf https://astral.sh/uv/install.sh | sh
          export PATH="$HOME/.local/bin:$PATH"
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"
          uv --version

If the container uses a different install location, a more robust variant is:

      - name: Install uv
        run: |
          curl -LsSf https://astral.sh/uv/install.sh | sh
          UV_BIN="$(find "$HOME" -type f -name uv | head -n 1)"
          test -n "$UV_BIN"
          echo "$(dirname "$UV_BIN")" >> "$GITHUB_PATH"
          export PATH="$(dirname "$UV_BIN"):$PATH"
          uv --version

Best solution

The cleanest fix is to standardize on astral-sh/setup-uv@v7 for this job, since the same workflow already uses it successfully in:

That removes the inconsistency that caused this failure.

User: Create a PR with this fix

Assistant: I’ve started the pull request creati...

This pull request was created from Copilot chat.

Copilot AI requested review from Copilot and removed request for Copilot May 14, 2026 18:54
Copilot AI requested review from Copilot and removed request for Copilot May 14, 2026 18:58
Copilot AI changed the title [WIP] Fix uv installation in Release workflow Use setup-uv in Release test container job May 14, 2026
Copilot AI requested a review from ppenna May 14, 2026 18:59
Copilot finished work on behalf of ppenna May 14, 2026 18:59
@ppenna
ppenna marked this pull request as ready for review May 14, 2026 19:13
Copilot AI review requested due to automatic review settings May 14, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Release workflow’s containerized Linux test job by replacing the unreliable shell-based uv installer with the same official astral-sh/setup-uv@v7 action used elsewhere in the repository workflows.

Changes:

  • Replaces curl ... | sh uv installation in the Release test job.
  • Configures setup-uv with Python 3.12 for consistency with other jobs.
Show a summary per file
File Description
.github/workflows/release.yml Updates the Linux Release test job to install uv via astral-sh/setup-uv@v7.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@ppenna
ppenna merged commit 359bf77 into dev May 14, 2026
10 checks passed
@ppenna
ppenna deleted the copilot/fix-uv-installation-test-job branch May 14, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants