Skip to content

Commit

Permalink
Fix CI (#1788)
Browse files Browse the repository at this point in the history
* Use `inspect_err` over `map_err`

* Remove lifetimes that can be elided

* Revert me: Account for false-positive in clippy

* Apply `cargo fmt`

* Use GitHub binaries of `substrate-contracts-node` over removed GitLab releases

* Fix url

* Use shell globbing
  • Loading branch information
cmichi authored Nov 4, 2024
1 parent b183e9e commit d7bac60
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,20 +240,20 @@ jobs:

- name: Install latest `substrate-contracts-node` binary
env:
CONTRACTS_NODE_URL: https://gitlab.parity.io/parity/mirrors/substrate-contracts-node/-/jobs/artifacts/main/download
CONTRACTS_NODE_URL: https://github.com/paritytech/substrate-contracts-node/releases/latest/download/substrate-contracts-node-
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
CONTRACTS_NODE_OS=linux
elif [ "$RUNNER_OS" == "macOS" ]; then
CONTRACTS_NODE_OS=mac
CONTRACTS_NODE_OS=mac-universal
else
echo "$RUNNER_OS not supported"
exit 1
fi
curl -L -o substrate-contracts-node.zip "$CONTRACTS_NODE_URL?job=build-$CONTRACTS_NODE_OS"
unzip substrate-contracts-node.zip
chmod +x artifacts/substrate-contracts-node-$CONTRACTS_NODE_OS/substrate-contracts-node &&
mv artifacts/substrate-contracts-node-$CONTRACTS_NODE_OS/substrate-contracts-node /usr/local/bin
curl -L -o substrate-contracts-node.tar.gz "$CONTRACTS_NODE_URL$CONTRACTS_NODE_OS.tar.gz"
tar xfzv substrate-contracts-node.tar.gz
chmod +x artifacts/substrate-contracts-node-*/substrate-contracts-node &&
mv artifacts/substrate-contracts-node-*/substrate-contracts-node /usr/local/bin
shell: bash

- name: Run integration tests
Expand Down
3 changes: 3 additions & 0 deletions crates/build/src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ fn update_build_result(host_folder: &Path, build_result: &mut BuildResult) -> Re
});
build_result.dest_wasm = new_path;

// TODO: Clippy currently throws a false-positive here. The manual allow can be
// removed after https://github.com/rust-lang/rust-clippy/pull/13609 has been released.
#[allow(clippy::manual_inspect)]
build_result.metadata_result.as_mut().map(|m| {
m.dest_bundle = host_folder.join(
m.dest_bundle
Expand Down
5 changes: 2 additions & 3 deletions crates/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,10 @@ pub fn execute(args: ExecuteArgs) -> Result<BuildResult> {
}
BuildArtifacts::All => {
let (opt_result, build_info, dest_wasm) =
local_build(&crate_metadata, &optimization_passes, &args).map_err(
|e| {
local_build(&crate_metadata, &optimization_passes, &args).inspect_err(
|_| {
// build error -> bundle is stale
clean_metadata();
e
},
)?;

Expand Down
4 changes: 2 additions & 2 deletions crates/metadata/src/byte_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ where
{
struct Visitor;

impl<'b> serde::de::Visitor<'b> for Visitor {
impl serde::de::Visitor<'_> for Visitor {
type Value = Vec<u8>;

fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
Expand Down Expand Up @@ -64,7 +64,7 @@ where
{
struct Visitor;

impl<'b> serde::de::Visitor<'b> for Visitor {
impl serde::de::Visitor<'_> for Visitor {
type Value = [u8; 32];

fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
Expand Down
8 changes: 4 additions & 4 deletions crates/transcode/src/scon/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use std::fmt::{
/// Wraps Value for custom Debug impl to provide pretty-printed Display
struct DisplayValue<'a>(&'a Value);

impl<'a> Debug for DisplayValue<'a> {
impl Debug for DisplayValue<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
match &self.0 {
Value::Bool(boolean) => <bool as Debug>::fmt(boolean, f),
Expand Down Expand Up @@ -61,7 +61,7 @@ impl Display for Value {

struct DisplayMap<'a>(&'a Map);

impl<'a> Debug for DisplayMap<'a> {
impl Debug for DisplayMap<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
match self.0.ident {
Some(ref name) => {
Expand All @@ -84,7 +84,7 @@ impl<'a> Debug for DisplayMap<'a> {

struct DisplayTuple<'a>(&'a Tuple);

impl<'a> Debug for DisplayTuple<'a> {
impl Debug for DisplayTuple<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
let name = self.0.ident.as_ref().map_or("", |s| s.as_str());
let mut builder = f.debug_tuple(name);
Expand All @@ -97,7 +97,7 @@ impl<'a> Debug for DisplayTuple<'a> {

struct DisplaySeq<'a>(&'a Seq);

impl<'a> Debug for DisplaySeq<'a> {
impl Debug for DisplaySeq<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
let mut builder = f.debug_list();
for elem in &self.0.elems {
Expand Down

0 comments on commit d7bac60

Please sign in to comment.