You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2023/07/20 04:13:41 UTC

[incubator-opendal] branch main updated: ci: Setup protoc in rust builder (#2674)

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

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 07a4b39cf ci: Setup protoc in rust builder (#2674)
07a4b39cf is described below

commit 07a4b39cffdf945fc4e698a66ce52f11d3162caa
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Thu Jul 20 12:13:37 2023 +0800

    ci: Setup protoc in rust builder (#2674)
    
    * ci: Setup protoc in rust builder
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * trigger build
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * Use apt to install
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * Fix
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    ---------
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
 .github/actions/setup/action.yaml | 7 +++++++
 .github/workflows/ci.yml          | 3 +++
 .github/workflows/docs.yml        | 1 +
 .github/workflows/publish.yml     | 4 ++++
 core/src/services/oss/backend.rs  | 1 +
 5 files changed, 16 insertions(+)

diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml
index 257e5c57c..d1db35edb 100644
--- a/.github/actions/setup/action.yaml
+++ b/.github/actions/setup/action.yaml
@@ -22,6 +22,8 @@ inputs:
     description: "This setup needs rocksdb or not"
   need-nextest:
     description: "This setup needs nextest or not"
+  need-protoc:
+    description: "This setup needs protoc or not"
 
 runs:
   using: "composite"
@@ -39,6 +41,11 @@ runs:
         # Enable sparse index
         echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
 
+    - name: Setup protoc on linux
+      if: inputs.need-protoc == 'true' && runner.os == 'Linux'
+      shell: bash
+      run: sudo apt install -y protobuf-compiler
+
     - name: Cache nextest on linux
       id: cache-nextest
       uses: actions/cache@v3
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a25879e8a..c73c8a1bd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -59,6 +59,7 @@ jobs:
         uses: ./.github/actions/setup
         with:
           need-rocksdb: true
+          need-protoc: true
 
       - name: Checkout python env
         uses: actions/setup-python@v4
@@ -83,6 +84,7 @@ jobs:
         uses: ./.github/actions/setup
         with:
           need-rocksdb: true
+          need-protoc: true
 
       - name: Checkout python env
         uses: actions/setup-python@v4
@@ -145,6 +147,7 @@ jobs:
         uses: ./.github/actions/setup
         with:
           need-rocksdb: true
+          need-protoc: true
 
       - name: Build
         run: cargo build --all-features
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index b14c29450..da5fc1101 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -44,6 +44,7 @@ jobs:
         uses: ./.github/actions/setup
         with:
           need-rocksdb: true
+          need-protoc: true
 
       - uses: actions/setup-java@v3
         with:
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index f0e8a3a41..bc85c667f 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -36,8 +36,12 @@ jobs:
         with:
           distribution: temurin
           java-version: "11"
+
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
+        with:
+          need-rocksdb: true
+          need-protoc: true
 
       - name: Publish opendal
         working-directory: "core"
diff --git a/core/src/services/oss/backend.rs b/core/src/services/oss/backend.rs
index e3bb47456..370c7d2e7 100644
--- a/core/src/services/oss/backend.rs
+++ b/core/src/services/oss/backend.rs
@@ -40,6 +40,7 @@ use crate::*;
 
 const DEFAULT_WRITE_MIN_SIZE: usize = 8 * 1024 * 1024;
 const DEFAULT_BATCH_MAX_OPERATIONS: usize = 1000;
+
 /// Aliyun Object Storage Service (OSS) support
 #[doc = include_str!("docs.md")]
 #[derive(Default)]