goosefs-sdk 0.1.9

Goosefs Rust gRPC Client - Direct gRPC client for Goosefs Master/Worker
Documentation
# Copyright (C) 2026 Tencent. All rights reserved.
#
# Licensed 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: CI

on:
  push:
    branches: [main, master]
    paths-ignore:
      - "website/**"
      - ".github/workflows/docs.yml"
  pull_request:
    paths-ignore:
      - "website/**"
      - ".github/workflows/docs.yml"
  workflow_dispatch:

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  check:
    name: check (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        # macos-14 = Apple Silicon (M-series / M4-class GHA runners)
        # windows-latest = MSVC; io-uring is Linux-only and target-gated
        os:
          - ubuntu-latest
          - macos-14
          - windows-latest
    steps:
      - uses: actions/checkout@v7

      - name: Setup Rust
        uses: ./.github/actions/setup
        with:
          components: rustfmt,clippy

      - name: cargo fmt
        run: cargo fmt --all -- --check

      - name: cargo check (workspace)
        run: cargo check --workspace --all-targets

      # Existing crate has clippy debt; keep clippy visible but do not
      # fail the job on pedantic lints until they are cleaned up.
      - name: cargo clippy (sdk)
        run: cargo clippy -p goosefs-sdk --all-targets

      - name: cargo clippy (python binding)
        run: cargo clippy -p goosefs-python --all-targets

  unit-rust:
    name: unit-rust (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - macos-14
          - windows-latest
    steps:
      - uses: actions/checkout@v7

      - name: Setup Rust
        uses: ./.github/actions/setup
        with:
          need-nextest: "true"

      - name: Unit + hermetic integration tests
        shell: bash
        run: |
          # Skips #[ignore] (cluster e2e + uring store tests that need
          # host io_uring OPENAT, which GitHub Actions denies with EPERM).
          cargo nextest run --workspace --no-fail-fast --lib --tests

      - name: Doc tests
        run: cargo test --workspace --doc --no-fail-fast

  unit-python:
    name: unit-python (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - macos-14
          - windows-latest
        python-version: ["3.11"]
    steps:
      - uses: actions/checkout@v7

      - name: Setup Rust
        uses: ./.github/actions/setup

      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          enable-cache: true

      - name: Setup Python
        uses: actions/setup-python@v7
        with:
          python-version: ${{ matrix.python-version }}

      - name: Sync + build binding
        shell: bash
        working-directory: bindings/python
        run: |
          uv sync --all-extras --group dev --group test
          uv run maturin develop --uv

      - name: Ruff
        working-directory: bindings/python
        run: uv run ruff check python/goosefs tests examples

      - name: Pytest (hermetic; no cluster)
        working-directory: bindings/python
        # Without GOOSEFS_MASTER_ADDR, conftest skips cluster suites.
        run: uv run --group test pytest -q

  offline-benchmarks:
    name: offline-benchmarks (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - macos-14
          - windows-latest
    steps:
      - uses: actions/checkout@v7

      - name: Setup Rust
        uses: ./.github/actions/setup

      - name: Offline Rust benchmarks
        shell: bash
        run: bash scripts/ci/run_rust_benchmarks.sh offline