This is an automated email from the ASF dual-hosted git repository.

koushiro pushed a commit to branch fix-core-ci
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit a599b0d8dfc57da69126221c2406d3630e2e1277
Author: koushiro <[email protected]>
AuthorDate: Wed Dec 17 14:10:56 2025 +0800

    fix(core): add --workspace arg to core clippy/test ci
---
 .github/workflows/ci_core.yml    | 6 +++---
 core/Cargo.lock                  | 2 ++
 core/services/compfs/Cargo.toml  | 4 ++++
 core/services/compfs/src/core.rs | 6 +++---
 core/services/opfs/Cargo.toml    | 5 ++---
 core/services/opfs/src/lib.rs    | 2 ++
 6 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/ci_core.yml b/.github/workflows/ci_core.yml
index 460449ee3..3c8132d94 100644
--- a/.github/workflows/ci_core.yml
+++ b/.github/workflows/ci_core.yml
@@ -75,7 +75,7 @@ jobs:
 
       - name: Cargo clippy
         working-directory: core
-        run: cargo clippy --all-targets --all-features -- -D warnings
+        run: cargo clippy --workspace --all-targets --all-features -- -D 
warnings
 
   check_msrv:
     runs-on: ubuntu-latest
@@ -267,8 +267,8 @@ jobs:
       - name: Test
         working-directory: core
         run: |
-          cargo nextest run --no-fail-fast --all-features
-          cargo test --doc --all-features
+          cargo nextest run --workspace --no-fail-fast --all-features
+          cargo test --workspace --doc --all-features
         env:
           # Add rocksdb and java lib path to LD_LIBRARY_PATH
           LD_LIBRARY_PATH: /tmp/rocksdb/lib:${{ env.JAVA_HOME 
}}/lib/server:${{ env.LD_LIBRARY_PATH }}
diff --git a/core/Cargo.lock b/core/Cargo.lock
index 20c027cb8..65ba114e0 100644
--- a/core/Cargo.lock
+++ b/core/Cargo.lock
@@ -5988,9 +5988,11 @@ dependencies = [
 name = "opendal-service-compfs"
 version = "0.55.0"
 dependencies = [
+ "bytes",
  "compio",
  "ctor",
  "opendal-core",
+ "rand 0.8.5",
  "serde",
 ]
 
diff --git a/core/services/compfs/Cargo.toml b/core/services/compfs/Cargo.toml
index 0de5a3c23..2977fde59 100644
--- a/core/services/compfs/Cargo.toml
+++ b/core/services/compfs/Cargo.toml
@@ -43,3 +43,7 @@ compio = { version = "0.16.0", features = [
 ] }
 ctor = { workspace = true }
 serde = { workspace = true, features = ["derive"] }
+
+[dev-dependencies]
+bytes = { workspace = true }
+rand = { workspace = true }
diff --git a/core/services/compfs/src/core.rs b/core/services/compfs/src/core.rs
index 4ec94fc68..71981f045 100644
--- a/core/services/compfs/src/core.rs
+++ b/core/services/compfs/src/core.rs
@@ -112,7 +112,7 @@ mod tests {
 
     use super::*;
 
-    fn setup_buffer() -> (Buffer, usize, Bytes) {
+    fn setup_buffer() -> (CompfsBuffer, usize, Bytes) {
         let mut rng = thread_rng();
 
         let bs = (0..100)
@@ -128,7 +128,7 @@ mod tests {
         let total_content = bs.iter().flatten().copied().collect::<Bytes>();
         let buf = Buffer::from(bs);
 
-        (buf, total_size, total_content)
+        (CompfsBuffer(buf), total_size, total_content)
     }
 
     #[test]
@@ -136,6 +136,6 @@ mod tests {
         let (buf, _len, _bytes) = setup_buffer();
         let slice = IoBuf::as_slice(&buf);
 
-        assert_eq!(slice, buf.current().chunk())
+        assert_eq!(slice, buf.0.current().chunk())
     }
 }
diff --git a/core/services/opfs/Cargo.toml b/core/services/opfs/Cargo.toml
index 336b2e422..fc9107ced 100644
--- a/core/services/opfs/Cargo.toml
+++ b/core/services/opfs/Cargo.toml
@@ -30,11 +30,10 @@ version = { workspace = true }
 [package.metadata.docs.rs]
 all-features = true
 
-[dependencies]
-opendal-core = { path = "../../core", version = "0.55.0", default-features = 
false }
-
+[target.'cfg(target_arch = "wasm32")'.dependencies]
 ctor = { workspace = true }
 js-sys = "0.3.77"
+opendal-core = { path = "../../core", version = "0.55.0", default-features = 
false }
 serde = { workspace = true, features = ["derive"] }
 wasm-bindgen = "0.2.100"
 wasm-bindgen-futures = "0.4.50"
diff --git a/core/services/opfs/src/lib.rs b/core/services/opfs/src/lib.rs
index 0c391e162..98fb8bcba 100644
--- a/core/services/opfs/src/lib.rs
+++ b/core/services/opfs/src/lib.rs
@@ -15,6 +15,8 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#![cfg(target_arch = "wasm32")]
+
 /// Default scheme for opfs service.
 pub const OPFS_SCHEME: &str = "opfs";
 

Reply via email to