You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by ti...@apache.org on 2026/07/31 09:46:30 UTC

(opendal) branch main updated: ci(bindings/dotnet): reduce native library size and simplify test workflow (#7998)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 35a5a3d61 ci(bindings/dotnet): reduce native library size and simplify test workflow (#7998)
35a5a3d61 is described below

commit 35a5a3d610a8d564588aca723bb6f9a6489cb319
Author: Fatorin <sk...@gmail.com>
AuthorDate: Fri Jul 31 17:46:24 2026 +0800

    ci(bindings/dotnet): reduce native library size and simplify test workflow (#7998)
    
    * ci: reduce dotnet release artifact size
    
    * ci: build the native library once per OS for dotnet
---
 .github/workflows/ci_bindings_dotnet.yml | 25 ++++++++++++-------------
 bindings/dotnet/Cargo.toml               |  6 ++++++
 2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/.github/workflows/ci_bindings_dotnet.yml b/.github/workflows/ci_bindings_dotnet.yml
index 445e2e9a4..9486a69c1 100644
--- a/.github/workflows/ci_bindings_dotnet.yml
+++ b/.github/workflows/ci_bindings_dotnet.yml
@@ -44,10 +44,6 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v7
-      - name: Setup dotnet toolchain
-        uses: actions/setup-dotnet@v5
-        with:
-          dotnet-version: '10.0.x'
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
         with:
@@ -74,15 +70,14 @@ jobs:
           - ubuntu-latest
           - macos-latest
           - windows-latest
-        dotnet-version:
-          - '8.0.x'
-          - '10.0.x'
     steps:
       - uses: actions/checkout@v7
       - name: Setup dotnet toolchain
         uses: actions/setup-dotnet@v5
         with:
-          dotnet-version: ${{ matrix.dotnet-version }}
+          dotnet-version: |
+            8.0.x
+            10.0.x
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
         with:
@@ -91,11 +86,13 @@ jobs:
           need-rocksdb: true
           github-token: ${{ secrets.GITHUB_TOKEN }}
 
-      - name: Build & Test
+      - name: Build native library
         working-directory: "bindings/dotnet"
-        run: |
-          cargo build
-          dotnet test -f ${{ matrix.dotnet-version == '8.0.x' && 'net8.0' || 'net10.0' }}
+        run: cargo build
+
+      - name: Test
+        working-directory: "bindings/dotnet"
+        run: dotnet test
         env:
           OPENDAL_TEST: memory
 
@@ -104,5 +101,7 @@ jobs:
       # bad docs. It uses the in-memory service, so it needs no credentials.
       - name: Run guide example
         working-directory: "bindings/dotnet"
+        shell: bash
         run: |
-          dotnet run --project examples/GettingStarted -f ${{ matrix.dotnet-version == '8.0.x' && 'net8.0' || 'net10.0' }}
+          dotnet run --project examples/GettingStarted -f net8.0
+          dotnet run --project examples/GettingStarted -f net10.0
diff --git a/bindings/dotnet/Cargo.toml b/bindings/dotnet/Cargo.toml
index 89adee7ab..56ab13bb1 100644
--- a/bindings/dotnet/Cargo.toml
+++ b/bindings/dotnet/Cargo.toml
@@ -120,3 +120,9 @@ features = [
   "services-sftp",
 ]
 path = "../../core"
+
+[profile.release]
+codegen-units = 1
+lto = "fat"
+panic = "abort"
+strip = true