Set up a single executor based on its support level on the current system. Unsupported executors or executors that require manual installation are skipped, not treated as fatal.
(
executor: &dyn Executor,
system_info: &SystemInfo,
setup_cache_dir: Option<&Path>,
)
| 71 | /// Unsupported executors or executors that require manual installation are |
| 72 | /// skipped, not treated as fatal. |
| 73 | async fn setup_executor( |
| 74 | executor: &dyn Executor, |
| 75 | system_info: &SystemInfo, |
| 76 | setup_cache_dir: Option<&Path>, |
| 77 | ) -> Result<()> { |
| 78 | match executor.support_level(system_info) { |
| 79 | ExecutorSupport::Unsupported => { |
| 80 | info!( |
| 81 | "Skipping setup for the {} executor: not supported on {}", |
| 82 | executor.name(), |
| 83 | system_info.os |
| 84 | ); |
| 85 | } |
| 86 | ExecutorSupport::RequiresManualInstallation => { |
| 87 | info!( |
| 88 | "Skipping automatic setup for the {} executor on {}; install required tooling manually.", |
| 89 | executor.name(), |
| 90 | system_info.os |
| 91 | ); |
| 92 | } |
| 93 | ExecutorSupport::FullySupported => { |
| 94 | info!( |
| 95 | "Setting up the environment for the executor: {}", |
| 96 | executor.name() |
| 97 | ); |
| 98 | executor.setup(system_info, setup_cache_dir).await?; |
| 99 | executor.grant_privileges()?; |
| 100 | } |
| 101 | } |
| 102 | Ok(()) |
| 103 | } |
| 104 | |
| 105 | pub fn status(modes: &[RunnerMode]) -> Result<()> { |
| 106 | let system_info = SystemInfo::new()?; |
no test coverage detected