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

aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git


The following commit(s) were added to refs/heads/master by this push:
     new 8d3d8ad8 Fix rust build (#451)
8d3d8ad8 is described below

commit 8d3d8ad84ef6f7c197f5555eebd10300cbaf6a7e
Author: Aaron Ai <[email protected]>
AuthorDate: Sun Apr 2 12:55:32 2023 +0800

    Fix rust build (#451)
    
    * Fix rust build
    
    * Test: trigger the build of rust
    
    * Add rust buid result
    
    * Revert "Test: trigger the build of rust"
    
    This reverts commit 165a27c41761e480e94c21ca00be1e7a41235218.
---
 .github/workflows/build.yml      | 11 +++++++++--
 .github/workflows/rust.yml       | 29 -----------------------------
 .github/workflows/rust_build.yml | 22 ++++++++++++++++++++++
 3 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 87506fa3..e0a05767 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -15,6 +15,7 @@ jobs:
       golang: ${{ steps.filter.outputs.golang }}
       csharp: ${{ steps.filter.outputs.csharp }}
       php: ${{ steps.filter.outputs.php }}
+      rust: ${{ steps.filter.outputs.rust }}
     steps:
       - uses: actions/checkout@v2
       - uses: dorny/paths-filter@v2
@@ -31,6 +32,8 @@ jobs:
               - 'csharp/**'
             php:
               - 'php/**'
+            rust:
+              - 'rust/**'
   java-build:
     needs: [paths-filter]
     if: ${{ needs.paths-filter.outputs.java == 'true' }}
@@ -52,15 +55,19 @@ jobs:
     needs: [paths-filter]
     if: ${{ needs.paths-filter.outputs.php == 'true' }}
     uses: ./.github/workflows/php_build.yml
+  rust-build:
+    needs: [paths-filter]
+    if: ${{ needs.paths-filter.outputs.rust == 'true' }}
+    uses: ./.github/workflows/rust_build.yml
   build-result:
     runs-on: ubuntu-latest
-    needs: [java-build, cpp-build, csharp-build, golang-build, php-build]
+    needs: [java-build, cpp-build, csharp-build, golang-build, php-build, 
rust-build]
     if: ${{ always() }}
     steps:
       - uses: actions/checkout@v2
       - name: Collect build result
         run: |
-          if echo java-${{ needs.java-build.result }},cpp-${{ 
needs.cpp-build.result }},csharp-${{ needs.csharp-build.result }},golang-${{ 
needs.golang-build.result }},php-${{ needs.php-build.result }} | grep -E 
'cancelled|failure' -o > null
+          if echo java-${{ needs.java-build.result }},cpp-${{ 
needs.cpp-build.result }},csharp-${{ needs.csharp-build.result }},golang-${{ 
needs.golang-build.result }},php-${{ needs.php-build.result }},rust-${{ 
needs.rust-build.result }} | grep -E 'cancelled|failure' -o > null
           then
             echo "There are failed/cancelled builds"
             exit 1 
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
deleted file mode 100644
index 27c2a5d3..00000000
--- a/.github/workflows/rust.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: Rust
-on:
-  pull_request:
-    types: [opened, reopened, synchronize]
-    paths:
-      - 'rust/**'
-  push:
-    branches:
-      - master
-      - rust_dev
-    paths:
-      - 'rust/**'
-
-jobs:
-  build_and_test:
-    name: Rust project
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-      - uses: actions-rs/toolchain@v1
-        with:
-          toolchain: stable
-      - name: Build
-        working-directory: ./rust
-        run: cargo build
-
-      - name: Unit Test
-        working-directory: ./rust
-        run: cargo test
\ No newline at end of file
diff --git a/.github/workflows/rust_build.yml b/.github/workflows/rust_build.yml
new file mode 100644
index 00000000..c9f842d0
--- /dev/null
+++ b/.github/workflows/rust_build.yml
@@ -0,0 +1,22 @@
+name: Rust Build
+on:
+  workflow_call:
+jobs:
+  build:
+    name: "${{ matrix.os }}"
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-20.04, macos-11, windows-2022]
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+      - name: Build
+        working-directory: ./rust
+        run: cargo build
+
+      - name: Unit Test
+        working-directory: ./rust
+        run: cargo test
\ No newline at end of file

Reply via email to