mirror of
https://github.com/astral-sh/uv
synced 2026-01-21 21:40:11 -05:00
This file is too big for an LLM context window and several contributors have complained about it being too scary to touch. This also gets us collapsible sections in the UI. I renamed some jobs for clarity in the meantime. And added a meta-job for required checks passing so we can avoid churn in our "Settings" when we change job names. Note this was entirely refactored by Claude. --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
164 lines
5.4 KiB
YAML
164 lines
5.4 KiB
YAML
on:
|
|
workflow_call:
|
|
|
|
permissions: {}
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_NET_RETRY: 10
|
|
CARGO_TERM_COLOR: always
|
|
PYTHON_VERSION: "3.12"
|
|
RUSTUP_MAX_RETRIES: 10
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
# We use the large GitHub actions runners
|
|
# For Ubuntu and Windows, this requires Organization-level configuration
|
|
# See: https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners#about-ubuntu-and-windows-larger-runners
|
|
|
|
cargo-test-linux:
|
|
timeout-minutes: 10
|
|
runs-on: depot-ubuntu-22.04-16
|
|
name: "cargo test on linux"
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
|
|
|
|
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
|
|
|
- name: "Install Rust toolchain"
|
|
run: rustup show
|
|
|
|
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
|
|
with:
|
|
version: "0.9.24"
|
|
|
|
- name: "Install required Python versions"
|
|
run: uv python install
|
|
|
|
- name: "Install secret service"
|
|
run: |
|
|
sudo apt update -y
|
|
sudo apt install -y gnome-keyring
|
|
|
|
- name: "Start gnome-keyring"
|
|
# run gnome-keyring with 'foobar' as password for the login keyring
|
|
# this will create a new login keyring and unlock it
|
|
# the login password doesn't matter, but the keyring must be unlocked for the tests to work
|
|
run: gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar'
|
|
|
|
- name: "Install cargo nextest"
|
|
uses: taiki-e/install-action@d850aa816998e5cf15f67a78c7b933f2a5033f8a # v2.63.3
|
|
with:
|
|
tool: cargo-nextest
|
|
|
|
- name: "Cargo test"
|
|
env:
|
|
# Retry more than default to reduce flakes in CI
|
|
UV_HTTP_RETRIES: 5
|
|
run: |
|
|
cargo nextest run \
|
|
--cargo-profile fast-build \
|
|
--features python-patch,native-auth,secret-service \
|
|
--workspace \
|
|
--profile ci-linux
|
|
|
|
cargo-test-macos:
|
|
timeout-minutes: 20
|
|
# Only run macOS tests on main without opt-in
|
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'test:macos') || github.ref == 'refs/heads/main' }}
|
|
runs-on: depot-macos-14
|
|
name: "cargo test on macos"
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
|
|
|
|
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
|
|
|
- name: "Install Rust toolchain"
|
|
run: rustup show
|
|
|
|
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
|
|
with:
|
|
version: "0.9.24"
|
|
|
|
- name: "Install required Python versions"
|
|
run: uv python install
|
|
|
|
- name: "Install cargo nextest"
|
|
uses: taiki-e/install-action@d850aa816998e5cf15f67a78c7b933f2a5033f8a # v2.63.3
|
|
with:
|
|
tool: cargo-nextest
|
|
|
|
- name: "Cargo test"
|
|
env:
|
|
# Retry more than default to reduce flakes in CI
|
|
UV_HTTP_RETRIES: 5
|
|
run: |
|
|
cargo nextest run \
|
|
--cargo-profile fast-build \
|
|
--no-default-features \
|
|
--features python,python-managed,pypi,git,git-lfs,performance,crates-io,native-auth,apple-native \
|
|
--workspace \
|
|
--profile ci-macos
|
|
|
|
cargo-test-windows:
|
|
timeout-minutes: 15
|
|
runs-on: depot-windows-2022-16
|
|
name: "cargo test on windows"
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup Dev Drive
|
|
run: ${{ github.workspace }}/.github/workflows/setup-dev-drive.ps1
|
|
|
|
# actions/checkout does not let us clone into anywhere outside ${{ github.workspace }}, so we have to copy the clone...
|
|
- name: Copy Git Repo to Dev Drive
|
|
run: |
|
|
Copy-Item -Path "${{ github.workspace }}" -Destination "$Env:UV_WORKSPACE" -Recurse
|
|
|
|
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
|
|
with:
|
|
version: "0.9.24"
|
|
|
|
- name: "Install required Python versions"
|
|
run: uv python install
|
|
|
|
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
|
with:
|
|
workspaces: ${{ env.UV_WORKSPACE }}
|
|
|
|
- name: "Install Rust toolchain"
|
|
working-directory: ${{ env.UV_WORKSPACE }}
|
|
run: rustup show
|
|
|
|
- name: "Install cargo nextest"
|
|
uses: taiki-e/install-action@d850aa816998e5cf15f67a78c7b933f2a5033f8a # v2.63.3
|
|
with:
|
|
tool: cargo-nextest
|
|
|
|
- name: "Cargo test"
|
|
working-directory: ${{ env.UV_WORKSPACE }}
|
|
env:
|
|
# Retry more than default to reduce flakes in CI
|
|
UV_HTTP_RETRIES: 5
|
|
# Avoid permission errors during concurrent tests
|
|
# See https://github.com/astral-sh/uv/issues/6940
|
|
UV_LINK_MODE: copy
|
|
shell: bash
|
|
run: |
|
|
cargo nextest run \
|
|
--cargo-profile fast-build \
|
|
--no-default-features \
|
|
--features python,pypi,python-managed,native-auth,windows-native \
|
|
--workspace \
|
|
--profile ci-windows
|