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/03/21 14:48:47 UTC

[incubator-opendal] branch main updated: ci: Remove ROCKSDB_LIB_DIR after we didn't install librocksdb (#1719)

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 99ac212f ci: Remove ROCKSDB_LIB_DIR after we didn't install librocksdb (#1719)
99ac212f is described below

commit 99ac212f7eea8bd77edb7d91e61bede7935831f1
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Tue Mar 21 22:48:41 2023 +0800

    ci: Remove ROCKSDB_LIB_DIR after we didn't install librocksdb (#1719)
    
    * ci: Don't cache target folder
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * Fix CI
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * Split cache key
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    ---------
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
 .github/actions/setup/action.yaml          | 11 ++++++++++-
 .github/workflows/ci.yml                   |  4 ++++
 .github/workflows/docs.yml                 | 11 ++++++-----
 .github/workflows/publish.yml              |  3 ---
 .github/workflows/service_test_rocksdb.yml |  3 ++-
 5 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml
index abd7dac6..304208d1 100644
--- a/.github/actions/setup/action.yaml
+++ b/.github/actions/setup/action.yaml
@@ -17,6 +17,12 @@
 
 name: Setup Rust Builder
 description: 'Prepare Rust Build Environment'
+inputs:
+  cache-key:
+    description: 'the rust cache key suffix'
+    required: false
+    default: ''
+
 runs:
   using: "composite"
   steps:
@@ -27,7 +33,10 @@ runs:
           ~/.cargo/bin/
           ~/.cargo/registry/cache/
           target/
-        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}${{ inputs.cache-key }}
+        restore-keys: |
+          ${{ runner.os }}-cargo
+          ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
 
     - name: Setup rust related environment variables
       shell: bash
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index aa00cf5f..f05a5e24 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -54,6 +54,8 @@ jobs:
 
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
+        with:
+          cache-key: "-services-all"
 
       - name: Check license headers
         uses: korandoru/hawkeye@v1.5.4
@@ -114,6 +116,8 @@ jobs:
 
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
+        with:
+          cache-key: "-services-all"
       - name: Build
         run: cargo build --all-features
 
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 8b1a1217..28f4a26f 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -39,6 +39,8 @@ jobs:
 
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
+        with:
+          cache-key: "-services-all"
 
       - uses: actions-rs/cargo@v1
         with:
@@ -46,7 +48,6 @@ jobs:
           args: --lib --no-deps --all-features -p opendal
         env:
           LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
-          ROCKSDB_LIB_DIR: /usr/lib
 
       - name: Copy docs into build
         run: |
@@ -83,12 +84,12 @@ jobs:
       - name: Copy docs into build
         run: |
           cp -r ./bindings/nodejs/docs ./website/static/docs/nodejs
-      
+
       # Setup python environment ----------------------------------------
       - uses: actions/setup-python@v4
         with:
           python-version: '3.11'
-      
+
       # Build bindings/python docs --------------------------------------
       - name: Install dependencies
         working-directory: bindings/python
@@ -96,11 +97,11 @@ jobs:
           set -e
           python -m pip install -e .
           python -m pip install pdoc
-      
+
       - name: Build bindings/python Docs
         working-directory: bindings/python
         run: pdoc --output-dir ./docs opendal
-      
+
       - name: Copy docs into build
         run: |
           cp -r ./bindings/python/docs ./website/static/docs/python
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index fd401244..f0e8a3a4 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -45,7 +45,6 @@ jobs:
         env:
           LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
           CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
-          ROCKSDB_LIB_DIR: /usr/lib
 
       - name: Publish object_store_opendal
         working-directory: "bindings/object_store"
@@ -53,7 +52,6 @@ jobs:
         env:
           LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
           CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
-          ROCKSDB_LIB_DIR: /usr/lib
 
       - name: Publish oli
         working-directory: "bin/oli"
@@ -61,4 +59,3 @@ jobs:
         env:
           LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
           CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
-          ROCKSDB_LIB_DIR: /usr/lib
diff --git a/.github/workflows/service_test_rocksdb.yml b/.github/workflows/service_test_rocksdb.yml
index d54997c8..694ef32a 100644
--- a/.github/workflows/service_test_rocksdb.yml
+++ b/.github/workflows/service_test_rocksdb.yml
@@ -45,12 +45,13 @@ jobs:
       - uses: actions/checkout@v3
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
+        with:
+          cache-key: "-services-rocksdb"
       - name: Test
         shell: bash
         working-directory: core
         run: cargo test rocksdb --features services-rocksdb -- --show-output --test-threads=1
         env:
-          ROCKSDB_LIB_DIR: /usr/lib
           RUST_BACKTRACE: full
           RUST_LOG: debug
           OPENDAL_ROCKSDB_TEST: on