diff --git a/.github/workflows/extension_tests.yml b/.github/workflows/extension_tests.yml index 3e2ef81f5bf7236b2df7b0a41e7cb22eb0546229..54a560704cee7bfb2e79076109d0a61a2ee8ba0b 100644 --- a/.github/workflows/extension_tests.yml +++ b/.github/workflows/extension_tests.yml @@ -76,7 +76,7 @@ jobs: - name: steps::cargo_install_nextest uses: taiki-e/install-action@nextest - name: steps::cargo_nextest - run: cargo nextest run --workspace --no-fail-fast + run: 'cargo nextest run --workspace --no-fail-fast --target "$(rustc -vV | sed -n ''s|host: ||p'')"' shell: bash -euxo pipefail {0} env: NEXTEST_NO_TESTS: warn diff --git a/tooling/xtask/src/tasks/workflows/extension_tests.rs b/tooling/xtask/src/tasks/workflows/extension_tests.rs index d1644a3cf280387ad43a7f27a81c0e95722741f7..5c419fc358c5a592776d64daf9480e39c435139e 100644 --- a/tooling/xtask/src/tasks/workflows/extension_tests.rs +++ b/tooling/xtask/src/tasks/workflows/extension_tests.rs @@ -69,7 +69,10 @@ fn check_rust() -> NamedJob { .add_step(run_clippy()) .add_step(steps::cargo_install_nextest()) .add_step( - steps::cargo_nextest(runners::Platform::Linux).add_env(("NEXTEST_NO_TESTS", "warn")), + steps::cargo_nextest(runners::Platform::Linux) + // Set the target to the current platform again + .with_target("$(rustc -vV | sed -n 's|host: ||p')") + .add_env(("NEXTEST_NO_TESTS", "warn")), ); named::job(job) diff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rs index 63ece051ec99c5f972ecf83b239c2663d05c9d07..90e28e08af39361a7b9dc16db223f913c901f45a 100644 --- a/tooling/xtask/src/tasks/workflows/steps.rs +++ b/tooling/xtask/src/tasks/workflows/steps.rs @@ -6,6 +6,30 @@ pub const BASH_SHELL: &str = "bash -euxo pipefail {0}"; // https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepsshell pub const PWSH_SHELL: &str = "pwsh"; +pub(crate) struct Nextest(Step); + +pub(crate) fn cargo_nextest(platform: Platform) -> Nextest { + Nextest(named::run( + platform, + "cargo nextest run --workspace --no-fail-fast", + )) +} + +impl Nextest { + pub(crate) fn with_target(mut self, target: &str) -> Step { + if let Some(nextest_command) = self.0.value.run.as_mut() { + nextest_command.push_str(&format!(r#" --target "{target}""#)); + } + self.into() + } +} + +impl From for Step { + fn from(value: Nextest) -> Self { + value.0 + } +} + pub fn checkout_repo() -> Step { named::uses( "actions", @@ -66,10 +90,6 @@ pub fn cargo_install_nextest() -> Step { named::uses("taiki-e", "install-action", "nextest") } -pub fn cargo_nextest(platform: Platform) -> Step { - named::run(platform, "cargo nextest run --workspace --no-fail-fast") -} - pub fn setup_cargo_config(platform: Platform) -> Step { match platform { Platform::Windows => named::pwsh(indoc::indoc! {r#"