You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by ps...@apache.org on 2026/08/10 14:37:13 UTC

(opendal-ofs) 03/03: ci: establish template-aligned quality gates

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

PsiACE pushed a commit to branch reset/direct-mount
in repository https://gitbox.apache.org/repos/asf/opendal-ofs.git

commit ec1a6dbc1f1330e8ebacc184f8cc1907d80f73f3
Author: PsiACE <ps...@apache.org>
AuthorDate: Mon Aug 10 22:31:14 2026 +0800

    ci: establish template-aligned quality gates
---
 .editorconfig                          | 12 ++++++++
 .github/actions/setup/action.yml       | 52 ----------------------------------
 .github/workflows/ci.yml               | 36 +++++++++++++++++------
 .github/workflows/ci.yml => taplo.toml | 41 +++++++++++----------------
 .github/workflows/ci.yml => typos.toml | 29 +++----------------
 5 files changed, 60 insertions(+), 110 deletions(-)

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..10b9476
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,12 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_style = space
+indent_size = 2
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.rs]
+indent_size = 4
diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml
deleted file mode 100644
index fb258af..0000000
--- a/.github/actions/setup/action.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name: Setup Rust Builder
-description: "Prepare Rust Build Environment"
-inputs:
-  need-protoc:
-    description: "This setup needs protoc or not"
-    default: "false"
-  github-token:
-    description: "Github Token"
-    default: ""
-
-runs:
-  using: "composite"
-  steps:
-    - name: Setup rust related environment variables
-      shell: bash
-      run: |
-        # Disable full debug symbol generation to speed up CI build and keep memory down
-        # "1" means line tables only, which is useful for panic tracebacks.
-        # About `force-frame-pointers`, here's the discussion history: https://github.com/apache/opendal/issues/3756
-        echo "RUSTFLAGS=-C force-frame-pointers=yes -C debuginfo=1" >> $GITHUB_ENV
-        # Enable backtraces
-        echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
-        # Enable logging
-        echo "RUST_LOG=opendal=trace" >> $GITHUB_ENV
-        # Enable sparse index
-        echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
-        # Make sure rust has been setup
-        cargo version
-
-    - name: Setup Protoc
-      if: inputs.need-protoc == 'true'
-      uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
-      with:
-        version: "23.4"
-        repo-token: ${{ inputs.github-token }}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5e4a47e..7945bfb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -25,19 +25,39 @@ on:
     branches:
       - main
 
+permissions:
+  contents: read
+
 concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
   cancel-in-progress: true
 
 jobs:
-  check_clippy_and_test:
-    runs-on: ubuntu-latest
+  check:
+    name: Check
+    runs-on: ubuntu-24.04
+    timeout-minutes: 30
     steps:
       - uses: actions/checkout@v7
 
-      - name: Setup Rust toolchain
-        uses: ./.github/actions/setup
-      - name: Cargo clippy && test
+      - name: Show Rust toolchain
         run: |
-          cargo clippy --all-targets --all-features -- -D warnings
-          cargo test --all-targets --all-features
+          rustc --version
+          cargo --version
+
+      - name: Check formatting
+        run: cargo fmt --all --check
+
+      - name: Check targets
+        run: cargo check --all-targets
+
+      - name: Run Clippy
+        run: cargo clippy --all-targets -- -D warnings
+
+      - name: Run tests
+        run: cargo test --all-targets
+
+      - name: Build documentation
+        env:
+          RUSTDOCFLAGS: -D warnings
+        run: cargo doc --no-deps
diff --git a/.github/workflows/ci.yml b/taplo.toml
similarity index 58%
copy from .github/workflows/ci.yml
copy to taplo.toml
index 5e4a47e..6c3c522 100644
--- a/.github/workflows/ci.yml
+++ b/taplo.toml
@@ -15,29 +15,20 @@
 # specific language governing permissions and limitations
 # under the License.
 
-name: Ofs CI
+exclude = ["target/**"]
+include = ["Cargo.toml", "**/*.toml"]
 
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    branches:
-      - main
-
-concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
-  cancel-in-progress: true
-
-jobs:
-  check_clippy_and_test:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v7
-
-      - name: Setup Rust toolchain
-        uses: ./.github/actions/setup
-      - name: Cargo clippy && test
-        run: |
-          cargo clippy --all-targets --all-features -- -D warnings
-          cargo test --all-targets --all-features
+[formatting]
+align_entries = false
+allowed_blank_lines = 1
+array_auto_collapse = true
+array_auto_expand = true
+array_trailing_comma = true
+column_width = 100
+compact_arrays = true
+compact_inline_tables = false
+crlf = false
+indent_string = "  "
+indent_tables = false
+reorder_keys = true
+trailing_newline = true
diff --git a/.github/workflows/ci.yml b/typos.toml
similarity index 58%
copy from .github/workflows/ci.yml
copy to typos.toml
index 5e4a47e..cbb9dc0 100644
--- a/.github/workflows/ci.yml
+++ b/typos.toml
@@ -15,29 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-name: Ofs CI
+[default.extend-words]
+OpenDAL = "OpenDAL"
 
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    branches:
-      - main
-
-concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
-  cancel-in-progress: true
-
-jobs:
-  check_clippy_and_test:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v7
-
-      - name: Setup Rust toolchain
-        uses: ./.github/actions/setup
-      - name: Cargo clippy && test
-        run: |
-          cargo clippy --all-targets --all-features -- -D warnings
-          cargo test --all-targets --all-features
+[files]
+extend-exclude = ["Cargo.lock"]