-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move outdated code to separate module * Begin prove_rpc.rs impl * Add initial envs and block input logic * Add most of prove_rpc.rs logic * Split runner module and add verify path * Update CI and docs * Test flow functional * Refactor cmd logic and fix zkproof file name * Verify output file * Fix import * RM superfluous check * Rename runner to process * Required flags to args * Fix spacing in actions yaml * Lint fix * Fix comments and readme and remove old script * Coalesce commands fns * Initial PR fixes before arg and process refactor * Remove process.rs and use Command directly * Inherit stdout/err * Undo whitespace rm in yamls * Fix readme
- Loading branch information
Showing
9 changed files
with
350 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
use std::process::{Command, Stdio}; | ||
|
||
use anyhow::Result; | ||
use anyhow::{ensure, Context as _}; | ||
use serde::Deserialize; | ||
|
||
#[derive(Deserialize)] | ||
struct Outdated<'a> { | ||
crate_name: &'a str, | ||
dependencies: Vec<Dependency<'a>>, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
struct Dependency<'a> { | ||
name: &'a str, | ||
project: &'a str, | ||
latest: &'a str, | ||
} | ||
|
||
pub fn list_outdated_deps() -> Result<()> { | ||
let output = Command::new("cargo") | ||
.args(["outdated", "--root-deps-only", "--format=json"]) | ||
.stderr(Stdio::inherit()) | ||
.stdout(Stdio::piped()) | ||
.output() | ||
.context("couldn't exec `cargo`")?; | ||
ensure!( | ||
output.status.success(), | ||
"command failed with {}", | ||
output.status | ||
); | ||
|
||
let outdated_items = serde_json::Deserializer::from_slice(&output.stdout) | ||
.into_iter::<Outdated<'_>>() | ||
.collect::<Result<Vec<_>, _>>() | ||
.context("failed to parse output from `cargo outdated`")?; | ||
for Outdated { | ||
crate_name, | ||
dependencies, | ||
} in outdated_items | ||
{ | ||
for Dependency { | ||
name, | ||
project, | ||
latest, | ||
} in dependencies | ||
{ | ||
// https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-a-warning-message | ||
println!("::warning title=outdated-dependency::dependency {name} of crate {crate_name} is at version {project}, but the latest is {latest}") | ||
} | ||
} | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.