Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump rust toolchain #37

Merged
merged 3 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.73.0"
channel = "1.79.0"
components = ["rustfmt", "clippy"]
2 changes: 2 additions & 0 deletions src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pub use crate::{end_group, start_group, start_opened_group};
#[allow(unused_imports)]
pub use anyhow::{anyhow, bail, ensure, Context, Error, Result};
pub use itertools::Itertools;
#[allow(unused_imports)]
pub use log::{debug, error, info, trace, warn};
9 changes: 4 additions & 5 deletions src/run/check_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl SystemInfo {
}

impl SystemInfo {
fn new() -> Result<Self> {
pub fn new() -> Result<Self> {
let os = System::name().ok_or(anyhow!("Failed to get OS name"))?;
let os_version = System::os_version().ok_or(anyhow!("Failed to get OS version"))?;
let arch = System::cpu_arch().ok_or(anyhow!("Failed to get CPU architecture"))?;
Expand All @@ -58,15 +58,14 @@ impl SystemInfo {
}
}

/// Checks if the system is supported and returns the system info
/// Checks if the provided system info is supported
///
/// Supported systems:
/// - Ubuntu 20.04 on x86_64
/// - Ubuntu 22.04 on x86_64
/// - Debian 11 on x86_64
/// - Debian 12 on x86_64
pub fn check_system() -> Result<SystemInfo> {
let system_info = SystemInfo::new()?;
pub fn check_system(system_info: &SystemInfo) -> Result<()> {
debug!("System info: {:#?}", system_info);

match (system_info.os.as_str(), system_info.os_version.as_str()) {
Expand All @@ -79,5 +78,5 @@ pub fn check_system() -> Result<SystemInfo> {
bail!("Only x86_64 is supported at the moment");
}

Ok(system_info)
Ok(())
}
5 changes: 4 additions & 1 deletion src/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::config::CodSpeedConfig;
use crate::prelude::*;
use crate::run::{config::Config, logger::Logger};
use crate::VERSION;
use check_system::SystemInfo;
use clap::Args;

mod check_system;
Expand Down Expand Up @@ -110,7 +111,9 @@ pub async fn run(args: RunArgs, api_client: &CodSpeedAPIClient) -> Result<()> {
config.set_token(codspeed_config.auth.token.clone());
}

let system_info = check_system::check_system()?;
let system_info = SystemInfo::new()?;
check_system::check_system(&system_info)?;

let run_data = runner::run(&config, &system_info).await?;

if !config.skip_upload {
Expand Down
Loading