Move smoke tests into dedicated jobs and build `uvx` explicitly (#10824)

In the interest of expanding these tests and debugging weird behaviors,
I've moved the smoke tests out of the `cargo test` job and into
dedicated `smoke test` jobs. We explicitly build `uvx` in the `build
binary` jobs instead of relying on the implicit build for the test run.

I also added a `uvx` test case to the smoke tests: `uvx ruff --version`
This commit is contained in:
Zanie Blue 2025-01-21 16:46:12 -06:00 committed by GitHub
parent 4574ced370
commit fd16988a4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 84 additions and 43 deletions

View File

@ -200,19 +200,6 @@ jobs:
--workspace \ --workspace \
--status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow
- name: "Smoke test"
run: |
uv="./target/debug/uv"
$uv venv -v
$uv pip install ruff -v
- name: "Smoke test completion"
run: |
uv="./target/debug/uv"
uvx="./target/debug/uvx"
eval "$($uv generate-shell-completion bash)"
eval "$($uvx --generate-shell-completion bash)"
cargo-test-macos: cargo-test-macos:
timeout-minutes: 10 timeout-minutes: 10
needs: determine_changes needs: determine_changes
@ -245,12 +232,6 @@ jobs:
--workspace \ --workspace \
--status-level skip --failure-output immediate-final --no-fail-fast -j 12 --final-status-level slow --status-level skip --failure-output immediate-final --no-fail-fast -j 12 --final-status-level slow
- name: "Smoke test"
run: |
uv="./target/debug/uv"
$uv venv -v
$uv pip install ruff -v
cargo-test-windows: cargo-test-windows:
timeout-minutes: 15 timeout-minutes: 15
needs: determine_changes needs: determine_changes
@ -294,22 +275,6 @@ jobs:
run: | run: |
cargo nextest run --no-default-features --features python,pypi,python-managed --workspace --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow cargo nextest run --no-default-features --features python,pypi,python-managed --workspace --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow
- name: "Smoke test"
working-directory: ${{ env.UV_WORKSPACE }}
run: |
Set-Alias -Name uv -Value ./target/debug/uv
uv venv -v
uv pip install ruff -v
- name: "Smoke test completion"
working-directory: ${{ env.UV_WORKSPACE }}
shell: powershell
run: |
Set-Alias -Name uv -Value ./target/debug/uv
Set-Alias -Name uvx -Value ./target/debug/uvx
(& uv generate-shell-completion powershell) | Out-String | Invoke-Expression
(& uvx --generate-shell-completion powershell) | Out-String | Invoke-Expression
# Separate jobs for the nightly crate # Separate jobs for the nightly crate
windows-trampoline-check: windows-trampoline-check:
timeout-minutes: 15 timeout-minutes: 15
@ -451,13 +416,15 @@ jobs:
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- name: "Build" - name: "Build"
run: cargo build --target x86_64-unknown-linux-musl run: cargo build --target x86_64-unknown-linux-musl --bin uv --bin uvx
- name: "Upload binary" - name: "Upload binary"
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: uv-linux-${{ github.sha }} name: uv-linux-${{ github.sha }}
path: ./target/x86_64-unknown-linux-musl/debug/uv path: |
./target/x86_64-unknown-linux-musl/debug/uv
./target/x86_64-unknown-linux-musl/debug/uvx
retention-days: 1 retention-days: 1
build-binary-macos-aarch64: build-binary-macos-aarch64:
@ -473,13 +440,15 @@ jobs:
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- name: "Build" - name: "Build"
run: cargo build run: cargo build --bin uv --bin uvx
- name: "Upload binary" - name: "Upload binary"
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: uv-macos-aarch64-${{ github.sha }} name: uv-macos-aarch64-${{ github.sha }}
path: ./target/debug/uv path: |
./target/debug/uv
./target/debug/uvx
retention-days: 1 retention-days: 1
build-binary-macos-x86_64: build-binary-macos-x86_64:
@ -495,13 +464,15 @@ jobs:
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- name: "Build" - name: "Build"
run: cargo build run: cargo build --bin uv --bin uvx
- name: "Upload binary" - name: "Upload binary"
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: uv-macos-x86_64-${{ github.sha }} name: uv-macos-x86_64-${{ github.sha }}
path: ./target/debug/uv path: |
./target/debug/uv
./target/debug/uvx
retention-days: 1 retention-days: 1
build-binary-windows: build-binary-windows:
@ -527,13 +498,15 @@ jobs:
- name: "Build" - name: "Build"
working-directory: ${{ env.UV_WORKSPACE }} working-directory: ${{ env.UV_WORKSPACE }}
run: cargo build run: cargo build --bin uv --bin uvx
- name: "Upload binary" - name: "Upload binary"
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: uv-windows-${{ github.sha }} name: uv-windows-${{ github.sha }}
path: ${{ env.UV_WORKSPACE }}/target/debug/uv.exe path: |
${{ env.UV_WORKSPACE }}/target/debug/uv.exe
${{ env.UV_WORKSPACE }}/target/debug/uvx.exe
retention-days: 1 retention-days: 1
cargo-build-msrv: cargo-build-msrv:
@ -640,6 +613,74 @@ jobs:
./uv venv ./uv venv
./${{ matrix.command }} ./${{ matrix.command }}
smoke-test-linux:
timeout-minutes: 10
needs: build-binary-linux
name: "smoke test | linux"
runs-on: ubuntu-latest
steps:
- name: "Download binary"
uses: actions/download-artifact@v4
with:
name: uv-linux-${{ github.sha }}
- name: "Prepare binary"
run: |
chmod +x ./uv
chmod +x ./uvx
- name: "Smoke test"
run: |
./uv venv -v
./uv pip install ruff -v
./uvx -v ruff --version
eval "$(./uv generate-shell-completion bash)"
eval "$(./uvx --generate-shell-completion bash)"
smoke-test-macos:
timeout-minutes: 10
needs: build-binary-macos-x86_64
name: "smoke test | macos"
runs-on: macos-latest
steps:
- name: "Download binary"
uses: actions/download-artifact@v4
with:
name: uv-macos-x86_64-${{ github.sha }}
- name: "Prepare binary"
run: |
chmod +x ./uv
chmod +x ./uvx
- name: "Smoke test"
run: |
./uv venv -v
./uv pip install ruff -v
./uvx -v ruff --version
eval "$(./uv generate-shell-completion bash)"
eval "$(./uvx --generate-shell-completion bash)"
smoke-test-windows:
timeout-minutes: 10
needs: build-binary-windows
name: "smoke test | windows"
runs-on: windows-latest
steps:
- name: "Download binary"
uses: actions/download-artifact@v4
with:
name: uv-windows-${{ github.sha }}
- name: "Smoke test"
working-directory: ${{ env.UV_WORKSPACE }}
run: |
./uv venv -v
./uv pip install ruff -v
./uvx -v ruff --version
(& ./uv generate-shell-completion powershell) | Out-String | Invoke-Expression
(& ./uvx --generate-shell-completion powershell) | Out-String | Invoke-Expression
integration-test-conda: integration-test-conda:
timeout-minutes: 10 timeout-minutes: 10
needs: build-binary-linux needs: build-binary-linux