From d2108bf3607fdf9d148d43ab5bfbe36e9ccabaab Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 25 Jun 2024 11:29:30 -0400 Subject: [PATCH] Separate CI test runs from the matrix (#4518) So we can skip them when there are not code changes and still enforce our required checks (xref #4438) Otherwise, the names are dynamic and they are forever expected (see #4426 for example) --- .github/workflows/ci.yml | 68 +++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04c441fed..83b34f850 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,23 +114,53 @@ jobs: - run: cargo binstall --no-confirm cargo-shear - run: cargo shear - cargo-test-unix: + # 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: needs: determine_changes if: ${{ github.repository == 'astral-sh/uv' && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} - strategy: - matrix: - include: - # 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 - - os: "ubuntu" - runner: "ubuntu-latest-large" - - os: "macos" - runner: "macos-14" - fail-fast: false runs-on: - labels: ${{ matrix.runner }} - name: "cargo test | ${{ matrix.os }}" + labels: "ubuntu-latest-large" + name: "cargo test | ubuntu" + steps: + - uses: actions/checkout@v4 + - name: "Install Rust toolchain" + run: rustup show + + - uses: rui314/setup-mold@v1 + + - uses: Swatinem/rust-cache@v2 + + - name: "Install required Python versions" + run: | + cargo run toolchain install + + - name: "Install cargo nextest" + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + + - name: "Cargo test" + run: | + cargo nextest run \ + --features python-patch \ + --workspace \ + --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 + $uv pip install ruff + + cargo-test-macos: + needs: determine_changes + if: ${{ github.repository == 'astral-sh/uv' && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} + runs-on: + labels: "macos-14" + name: "cargo test | macos" steps: - uses: actions/checkout@v4 - name: "Install Rust toolchain" @@ -165,15 +195,9 @@ jobs: cargo-test-windows: needs: determine_changes if: ${{ github.repository == 'astral-sh/uv' && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} - strategy: - matrix: - include: - - os: "windows" - runner: "windows-latest-large" - fail-fast: false runs-on: - labels: ${{ matrix.runner }} - name: "cargo test | ${{ matrix.os }}" + labels: "windows-latest-large" + name: "cargo test | windows" steps: - name: Create Dev Drive using ReFS run: |