Skip to content

Commit

Permalink
Trying macos
Browse files Browse the repository at this point in the history
  • Loading branch information
sauliusgrigaitis committed Dec 27, 2024
1 parent f36572c commit db26001
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

Expand All @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions metrics/src/metric_sys.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
#[cfg(target_os = "linux")]
#[cfg(not(target_os = "windows"))]
use {
anyhow::bail,
psutil::{cpu, process::Process},
Expand All @@ -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<ProcessCpuMetric> {
#[expect(unused_assignments)]
let mut cpu_process_seconds_total = 0;
Expand Down Expand Up @@ -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<CpuMetric> {
let cpu = cpu::cpu_times()?;
let system_seconds = cpu.total().as_secs();
Expand Down

0 comments on commit db26001

Please sign in to comment.