runners.rs

 1pub const LINUX_SMALL: Runner = Runner("namespace-profile-2x4-ubuntu-2404");
 2pub const LINUX_DEFAULT: Runner = LINUX_XL;
 3pub const LINUX_XL: Runner = Runner("namespace-profile-16x32-ubuntu-2204");
 4pub const LINUX_LARGE: Runner = Runner("namespace-profile-8x16-ubuntu-2204");
 5pub const LINUX_MEDIUM: Runner = Runner("namespace-profile-4x8-ubuntu-2204");
 6
 7// Using Ubuntu 20.04 for minimal glibc version
 8pub const LINUX_X86_BUNDLER: Runner = Runner("namespace-profile-32x64-ubuntu-2004");
 9pub const LINUX_ARM_BUNDLER: Runner = Runner("namespace-profile-8x32-ubuntu-2004-arm-m4");
10
11pub const MAC_DEFAULT: Runner = Runner("self-mini-macos");
12pub const WINDOWS_DEFAULT: Runner = Runner("self-32vcpu-windows-2022");
13
14pub struct Runner(&'static str);
15
16impl Into<gh_workflow::RunsOn> for Runner {
17    fn into(self) -> gh_workflow::RunsOn {
18        self.0.into()
19    }
20}
21
22#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
23pub enum Arch {
24    X86_64,
25    AARCH64,
26}
27
28impl std::fmt::Display for Arch {
29    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30        match self {
31            Arch::X86_64 => write!(f, "x86_64"),
32            Arch::AARCH64 => write!(f, "aarch64"),
33        }
34    }
35}
36
37impl Arch {
38    pub fn triple(&self) -> &'static str {
39        match self {
40            Arch::X86_64 => "x86_64-unknown-linux-gnu",
41            Arch::AARCH64 => "aarch64-unknown-linux-gnu",
42        }
43    }
44
45    pub fn linux_bundler(&self) -> Runner {
46        match self {
47            Arch::X86_64 => LINUX_X86_BUNDLER,
48            Arch::AARCH64 => LINUX_ARM_BUNDLER,
49        }
50    }
51}
52
53#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
54pub enum Platform {
55    Windows,
56    Linux,
57    Mac,
58}
59
60impl std::fmt::Display for Platform {
61    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
62        match self {
63            Platform::Windows => write!(f, "windows"),
64            Platform::Linux => write!(f, "linux"),
65            Platform::Mac => write!(f, "mac"),
66        }
67    }
68}
69
70#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
71pub enum ReleaseChannel {
72    Nightly,
73}