diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bf6a8d5..12c98a38 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 }} @@ -32,6 +32,10 @@ jobs: if: runner.os == 'Linux' run: scripts/ci/clippy.bash --deny warnings - name: Run tests + if: runner.os == 'Macos' + run: cargo test --release --no-fail-fast -- --skip eth2_libp2p --skip gossipsub + - name: Run tests + if: runner.os != 'Macos' run: cargo test --release --no-fail-fast - name: Check consensus-spec-tests coverage (Linux) if: runner.os == 'Linux' 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();