From fc37f337fb60181e20892eb003d02ebb9d3693a8 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Wed, 17 May 2023 17:12:52 +0200 Subject: [PATCH] fix(ci): Fix path to `matrix-sdk-crypto-js` and allow `pushd` to return an error. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First off, this patch changes `pushd(…)` to `pushd(…)?` so that errors are propagated. Second, instead of assuming that all crates live in `crates/`, let's allow to precise a prefix, like `crates/` or `bindings/` directly in the “folder” path of `args`. --- xtask/src/ci.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/xtask/src/ci.rs b/xtask/src/ci.rs index 4130898bd..d9ce44228 100644 --- a/xtask/src/ci.rs +++ b/xtask/src/ci.rs @@ -343,34 +343,37 @@ fn run_wasm_pack_tests(cmd: Option) -> Result<()> { return Ok(()); } let args = BTreeMap::from([ - (WasmFeatureSet::MatrixSdkQrcode, ("matrix-sdk-qrcode", "")), + (WasmFeatureSet::MatrixSdkQrcode, ("crates/matrix-sdk-qrcode", "")), ( WasmFeatureSet::MatrixSdkNoDefault, - ("matrix-sdk", "--no-default-features --features js,rustls-tls --lib"), + ("crates/matrix-sdk", "--no-default-features --features js,rustls-tls --lib"), ), - (WasmFeatureSet::MatrixSdkBase, ("matrix-sdk-base", "--features js")), - (WasmFeatureSet::MatrixSdkCommon, ("matrix-sdk-common", "--features js")), - (WasmFeatureSet::MatrixSdkCryptoJs, ("matrix-sdk-crypto-js", "")), + (WasmFeatureSet::MatrixSdkBase, ("crates/matrix-sdk-base", "--features js")), + (WasmFeatureSet::MatrixSdkCommon, ("crates/matrix-sdk-common", "--features js")), + (WasmFeatureSet::MatrixSdkCryptoJs, ("bindings/matrix-sdk-crypto-js", "")), ( WasmFeatureSet::MatrixSdkIndexeddbStoresNoCrypto, - ("matrix-sdk", "--no-default-features --features js,indexeddb,rustls-tls --lib"), + ("crates/matrix-sdk", "--no-default-features --features js,indexeddb,rustls-tls --lib"), ), ( WasmFeatureSet::MatrixSdkIndexeddbStores, ( - "matrix-sdk", + "crates/matrix-sdk", "--no-default-features --features js,indexeddb,e2e-encryption,rustls-tls --lib", ), ), - (WasmFeatureSet::IndexeddbNoCrypto, ("matrix-sdk-indexeddb", "--no-default-features")), + ( + WasmFeatureSet::IndexeddbNoCrypto, + ("crates/matrix-sdk-indexeddb", "--no-default-features"), + ), ( WasmFeatureSet::IndexeddbWithCrypto, - ("matrix-sdk-indexeddb", "--no-default-features --features e2e-encryption"), + ("crates/matrix-sdk-indexeddb", "--no-default-features --features e2e-encryption"), ), ]); let run = |(folder, arg_set): (&str, &str)| { - let _p = pushd(format!("crates/{folder}")); + let _ = pushd(folder)?; cmd!("pwd").env(WASM_TIMEOUT_ENV_KEY, WASM_TIMEOUT_VALUE).run()?; // print dir so we know what might have failed cmd!("wasm-pack test --node -- ") .args(arg_set.split_whitespace())