Skip to content

Commit

Permalink
ci: add option to run workflows manually (#223)
Browse files Browse the repository at this point in the history
* ci: add option to run workflows manually

This results in a "Run workflow" button on the Actions page. See the
docs for [`workflow_dispatch`].

[`workflow_dispatch`]: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch

* fingerprint: upgrade `sysinfo` library

This change upgrades the `sysinfo` library to `0.28` to avoid
compilation issues on Windows due to an unaligned packed field (e.g.,
this [failure]). `sysinfo`'s API has changed slightly and this brings
Sightglass' usage up to speed.

[failure]: https://github.com/bytecodealliance/sightglass/actions/runs/4089163019/jobs/7051580568#step:6:459
  • Loading branch information
abrown authored Mar 7, 2023
1 parent b89f1a6 commit 6af503c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sightglass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/fingerprint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ regex = "1.5"
serde = { version = "1.0.136", features = ["derive"] }
sha2 = "0.10"
sightglass-build = { path = "../build" }
sysinfo = "0.23"
sysinfo = "0.28"
4 changes: 2 additions & 2 deletions crates/fingerprint/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::hash;
use anyhow::{anyhow, Result};
use serde::{Deserialize, Serialize};
use std::env;
use sysinfo::{ProcessorExt, System, SystemExt};
use sysinfo::{CpuExt, System, SystemExt};

/// Describes a fingerprinted system.
///
Expand Down Expand Up @@ -49,7 +49,7 @@ impl Machine {
// Gather some CPU information.
let arch = std::env::consts::ARCH.to_string();
sys.refresh_cpu();
let cpu = sys.global_processor_info().brand().to_string();
let cpu = sys.global_cpu_info().brand().to_string();

// Gather the memory information. The expected result should be in GiB (the 1024-base SI
// measurement commonly used for memory) but it is unclear whether `sysinfo` is returning KB
Expand Down

0 comments on commit 6af503c

Please sign in to comment.