diff --git a/.circleci/config.yml b/.circleci/config.yml index 5da99257..bf827857 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,10 +25,35 @@ jobs: - ~/.cargo - ~/.rustup key: fce01-{{ checksum "fce/Cargo.toml" }} + wit_embedder: + docker: + - image: circleci/rust:latest + environment: + RUST_BACKTRACE: 1 + #RUST_TEST_THREADS: 1 + steps: + - checkout + - restore_cache: + keys: + - wit_embedder01-{{ checksum "wit_embedder/Cargo.toml" }} + - run: | + rustup toolchain install stable + rustup component add rustfmt + rustup component add clippy + cd wit_embedder + cargo fmt --all -- --check --color always + cargo build -v --all-features + cargo test -v --all-features + cargo clippy -v + - save_cache: + paths: + - ~/.cargo + - ~/.rustup + key: wit_embedder01-{{ checksum "wit_embedder/Cargo.toml" }} workflows: version: 2.1 fce: jobs: - fce - + - wit_embedder diff --git a/wit_embedder/src/extracter.rs b/wit_embedder/src/extracter.rs index 09713331..49c98f46 100644 --- a/wit_embedder/src/extracter.rs +++ b/wit_embedder/src/extracter.rs @@ -14,10 +14,16 @@ pub fn extract_wit(wasm_file: PathBuf) -> Result { .collect::>(); if sections.is_empty() { - return Err(format!("Wasm binary doesn't contain {} section", WIT_SECTION_NAME)); + return Err(format!( + "Wasm binary doesn't contain {} section", + WIT_SECTION_NAME + )); } if sections.len() > 1 { - return Err(format!("Wasm binary contains more than one {} section", WIT_SECTION_NAME)); + return Err(format!( + "Wasm binary contains more than one {} section", + WIT_SECTION_NAME + )); } let default_ids = IdsToIndices::default();