ci: Install pre-built cargo nextest instead of rolling our own (#42556)

Piotr Osiewicz created

Closes #ISSUE

Release Notes:

- N/A

Change summary

.github/workflows/release.yml                        | 9 +--------
.github/workflows/release_nightly.yml                | 3 ---
.github/workflows/run_cron_unit_evals.yml            | 3 +--
.github/workflows/run_tests.yml                      | 9 +--------
.github/workflows/run_unit_evals.yml                 | 3 +--
tooling/xtask/src/tasks/workflows/run_agent_evals.rs | 2 +-
tooling/xtask/src/tasks/workflows/run_tests.rs       | 4 +++-
tooling/xtask/src/tasks/workflows/steps.rs           | 4 ++--
8 files changed, 10 insertions(+), 27 deletions(-)

Detailed changes

.github/workflows/release.yml 🔗

@@ -29,9 +29,6 @@ jobs:
     - name: steps::clippy
       run: ./script/clippy
       shell: bash -euxo pipefail {0}
-    - name: steps::cargo_install_nextest
-      run: cargo install cargo-nextest --locked
-      shell: bash -euxo pipefail {0}
     - name: steps::clear_target_dir_if_large
       run: ./script/clear-target-dir-if-larger-than 300
       shell: bash -euxo pipefail {0}
@@ -78,8 +75,7 @@ jobs:
       run: ./script/clippy
       shell: bash -euxo pipefail {0}
     - name: steps::cargo_install_nextest
-      run: cargo install cargo-nextest --locked
-      shell: bash -euxo pipefail {0}
+      uses: taiki-e/install-action@nextest
     - name: steps::clear_target_dir_if_large
       run: ./script/clear-target-dir-if-larger-than 250
       shell: bash -euxo pipefail {0}
@@ -112,9 +108,6 @@ jobs:
     - name: steps::clippy
       run: ./script/clippy.ps1
       shell: pwsh
-    - name: steps::cargo_install_nextest
-      run: cargo install cargo-nextest --locked
-      shell: pwsh
     - name: steps::clear_target_dir_if_large
       run: ./script/clear-target-dir-if-larger-than.ps1 250
       shell: pwsh

.github/workflows/release_nightly.yml 🔗

@@ -47,9 +47,6 @@ jobs:
     - name: steps::clippy
       run: ./script/clippy.ps1
       shell: pwsh
-    - name: steps::cargo_install_nextest
-      run: cargo install cargo-nextest --locked
-      shell: pwsh
     - name: steps::clear_target_dir_if_large
       run: ./script/clear-target-dir-if-larger-than.ps1 250
       shell: pwsh

.github/workflows/run_cron_unit_evals.yml 🔗

@@ -37,8 +37,7 @@ jobs:
       run: ./script/download-wasi-sdk
       shell: bash -euxo pipefail {0}
     - name: steps::cargo_install_nextest
-      run: cargo install cargo-nextest --locked
-      shell: bash -euxo pipefail {0}
+      uses: taiki-e/install-action@nextest
     - name: steps::clear_target_dir_if_large
       run: ./script/clear-target-dir-if-larger-than 250
       shell: bash -euxo pipefail {0}

.github/workflows/run_tests.yml 🔗

@@ -113,9 +113,6 @@ jobs:
     - name: steps::clippy
       run: ./script/clippy.ps1
       shell: pwsh
-    - name: steps::cargo_install_nextest
-      run: cargo install cargo-nextest --locked
-      shell: pwsh
     - name: steps::clear_target_dir_if_large
       run: ./script/clear-target-dir-if-larger-than.ps1 250
       shell: pwsh
@@ -164,8 +161,7 @@ jobs:
       run: ./script/clippy
       shell: bash -euxo pipefail {0}
     - name: steps::cargo_install_nextest
-      run: cargo install cargo-nextest --locked
-      shell: bash -euxo pipefail {0}
+      uses: taiki-e/install-action@nextest
     - name: steps::clear_target_dir_if_large
       run: ./script/clear-target-dir-if-larger-than 250
       shell: bash -euxo pipefail {0}
@@ -200,9 +196,6 @@ jobs:
     - name: steps::clippy
       run: ./script/clippy
       shell: bash -euxo pipefail {0}
-    - name: steps::cargo_install_nextest
-      run: cargo install cargo-nextest --locked
-      shell: bash -euxo pipefail {0}
     - name: steps::clear_target_dir_if_large
       run: ./script/clear-target-dir-if-larger-than 300
       shell: bash -euxo pipefail {0}

.github/workflows/run_unit_evals.yml 🔗

@@ -46,8 +46,7 @@ jobs:
       run: ./script/download-wasi-sdk
       shell: bash -euxo pipefail {0}
     - name: steps::cargo_install_nextest
-      run: cargo install cargo-nextest --locked
-      shell: bash -euxo pipefail {0}
+      uses: taiki-e/install-action@nextest
     - name: steps::clear_target_dir_if_large
       run: ./script/clear-target-dir-if-larger-than 250
       shell: bash -euxo pipefail {0}

tooling/xtask/src/tasks/workflows/run_agent_evals.rs 🔗

@@ -126,7 +126,7 @@ fn unit_evals(commit: Option<&Input>) -> Job {
         .add_step(steps::setup_cargo_config(Platform::Linux))
         .add_step(steps::cache_rust_dependencies_namespace())
         .map(steps::install_linux_dependencies)
-        .add_step(steps::cargo_install_nextest(Platform::Linux))
+        .add_step(steps::cargo_install_nextest())
         .add_step(steps::clear_target_dir_if_large(Platform::Linux))
         .add_step(match commit {
             Some(commit) => script_step.add_env(("UNIT_EVAL_COMMIT", commit)),

tooling/xtask/src/tasks/workflows/run_tests.rs 🔗

@@ -321,7 +321,9 @@ pub(crate) fn run_platform_tests(platform: Platform) -> NamedJob {
             )
             .add_step(steps::setup_node())
             .add_step(steps::clippy(platform))
-            .add_step(steps::cargo_install_nextest(platform))
+            .when(platform == Platform::Linux, |job| {
+                job.add_step(steps::cargo_install_nextest())
+            })
             .add_step(steps::clear_target_dir_if_large(platform))
             .add_step(steps::cargo_nextest(platform))
             .add_step(steps::cleanup_cargo_config(platform)),

tooling/xtask/src/tasks/workflows/steps.rs 🔗

@@ -48,8 +48,8 @@ pub fn cargo_fmt() -> Step<Run> {
     named::bash("cargo fmt --all -- --check")
 }
 
-pub fn cargo_install_nextest(platform: Platform) -> Step<Run> {
-    named::run(platform, "cargo install cargo-nextest --locked")
+pub fn cargo_install_nextest() -> Step<Use> {
+    named::uses("taiki-e", "install-action", "nextest")
 }
 
 pub fn cargo_nextest(platform: Platform) -> Step<Run> {