Skip to content

Commit

Permalink
chore: ** for all prs (#182)
Browse files Browse the repository at this point in the history
This allows the gh-action `tests+checks` to run on PRs to PRs, for
example.

Includes:

- nightly formatting fixes
  • Loading branch information
Zeeshan Lakhani authored Jul 5, 2023
1 parent 371c257 commit af9b1d1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ main ]

pull_request:
branches: [ '*' ]
branches: [ '**' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

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

5 changes: 1 addition & 4 deletions homestar-core/src/ipld/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ impl<T> fmt::Display for Link<T> {

impl<T> Clone for Link<T> {
fn clone(&self) -> Self {
Self {
cid: self.cid,
_marker: self._marker,
}
*self
}
}

Expand Down
4 changes: 2 additions & 2 deletions homestar-core/src/workflow/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ where
fn try_from(ipld: Ipld) -> Result<Self, Self::Error> {
let Ok(map) = from_ipld::<BTreeMap<String, Ipld>>(ipld.to_owned()) else {
if let Ok(invocation_result) = ipld.to_owned().try_into() {
return Ok(Input::Arg(invocation_result))
return Ok(Input::Arg(invocation_result));
} else {
return Ok(Input::Ipld(ipld))
return Ok(Input::Ipld(ipld));
}
};

Expand Down
6 changes: 3 additions & 3 deletions homestar-runtime/src/workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ impl<'a> Builder<'a> {
// Clone as we're owning the struct going backward.
let ptr: Pointer = Invocation::<Arg>::from(task.clone()).try_into()?;

let RunInstruction::Expanded(instr) = task.into_instruction() else {
bail!("workflow tasks/instructions must be expanded / inlined")
};
let RunInstruction::Expanded(instr) = task.into_instruction() else {
bail!("workflow tasks/instructions must be expanded / inlined")
};

// TODO: check if op is runnable on current node
// TODO LATER: check if op is registered on the network
Expand Down
47 changes: 22 additions & 25 deletions homestar-wasm/src/wasmtime/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,33 +110,30 @@ impl<T> Env<T> {
.func()
.results(&self.store);

let params: Vec<component::Val> = iter::zip(
param_types.iter(),
args.into_inner().into_iter(),
)
.try_fold(vec![], |mut acc, (typ, arg)| {
// Remove unwraps
let v = match arg {
Input::Ipld(ipld) => RuntimeVal::try_from(ipld, &InterfaceType::from(typ))
.unwrap()
.value(),
Input::Arg(val) => match val.into_inner() {
Arg::Ipld(ipld) => RuntimeVal::try_from(ipld, &InterfaceType::from(typ))
let params: Vec<component::Val> = iter::zip(param_types.iter(), args.into_inner())
.try_fold(vec![], |mut acc, (typ, arg)| {
// Remove unwraps
let v = match arg {
Input::Ipld(ipld) => RuntimeVal::try_from(ipld, &InterfaceType::from(typ))
.unwrap()
.value(),
Arg::Value(v) => v,
},
Input::Deferred(await_promise) => bail!(Error::PromiseError(
ResolveError::UnresolvedCidError(format!(
"deferred task not yet resolved for {}: {}",
await_promise.result(),
await_promise.instruction_cid()
))
)),
};
acc.push(v);
Ok::<_, Error>(acc)
})?;
Input::Arg(val) => match val.into_inner() {
Arg::Ipld(ipld) => RuntimeVal::try_from(ipld, &InterfaceType::from(typ))
.unwrap()
.value(),
Arg::Value(v) => v,
},
Input::Deferred(await_promise) => bail!(Error::PromiseError(
ResolveError::UnresolvedCidError(format!(
"deferred task not yet resolved for {}: {}",
await_promise.result(),
await_promise.instruction_cid()
))
)),
};
acc.push(v);
Ok::<_, Error>(acc)
})?;

let mut results_alloc: Vec<component::Val> = result_types
.iter()
Expand Down

0 comments on commit af9b1d1

Please sign in to comment.