diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bf6a8d5..d45a13f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} diff --git a/metrics/src/metric_sys.rs b/metrics/src/metric_sys.rs index 5b88eb03..50db2b91 100644 --- a/metrics/src/metric_sys.rs +++ b/metrics/src/metric_sys.rs @@ -1,5 +1,5 @@ use anyhow::Result; -#[cfg(target_os = "linux")] +#[cfg(not(target_os = "windows"))] use { anyhow::bail, psutil::{cpu, process::Process}, @@ -15,7 +15,7 @@ pub struct ProcessCpuMetric { pub memory_process_bytes: u64, } -#[cfg(target_os = "linux")] +#[cfg(not(target_os = "windows"))] pub fn get_process_cpu_metric() -> Result { #[expect(unused_assignments)] let mut cpu_process_seconds_total = 0; @@ -78,7 +78,7 @@ pub struct CpuMetric { } // TODO maybe work for MacOS or wider Unix? -#[cfg(target_os = "linux")] +#[cfg(not(target_os = "windows"))] pub fn get_cpu_metric() -> Result { let cpu = cpu::cpu_times()?; let system_seconds = cpu.total().as_secs();