Xuanwo commented on code in PR #5591:
URL: https://github.com/apache/opendal/pull/5591#discussion_r1947478818


##########
.github/workflows/ci_bindings_dart.yml:
##########
@@ -0,0 +1,89 @@
+# 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: Bindings Dart CI
+
+on:
+  push:
+    branches:
+      - main
+    tags:
+      - "*"
+  pull_request:
+    branches:
+      - main
+    paths:
+      - "core/**"
+      - "bindings/dart/**"
+      - ".github/workflows/ci_bindings_dart.yml"
+  workflow_dispatch:
+
+env:
+  FLUTTER_VERSION: "3.27.3"
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+
+      - name: Install Flutter
+        uses: subosito/flutter-action@v2
+        with:
+          flutter-version: ${{ env.FLUTTER_VERSION }}
+          channel: 'stable'
+  
+      - name: Install flutter_rust_bridge_codegen and cargo-expand and fvm
+        working-directory: bindings/dart
+        run: |
+          set -eux -o pipefail
+          curl -L --proto '=https' --tlsv1.2 -sSf 
https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh
 | bash
+          curl -fsSL https://fvm.app/install.sh | bash
+          cargo binstall --no-confirm --no-symlinks --force cargo-expand
+          cargo binstall --no-confirm --no-symlinks --force 
flutter_rust_bridge_codegen --version "2.7.1"

Review Comment:
   Hi, it's usually dangerous to download scripts and run them in CI.
   
   - We already have `subosito/flutter-action@v2`; do we still need FVM?
   - Why do we need `cargo-expand`?
   - To start, we can simply run `cargo install flutter_rust_bridge_codegen`.



##########
.github/workflows/ci_bindings_dart.yml:
##########
@@ -0,0 +1,89 @@
+# 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: Bindings Dart CI
+
+on:
+  push:
+    branches:
+      - main
+    tags:
+      - "*"
+  pull_request:
+    branches:
+      - main
+    paths:
+      - "core/**"
+      - "bindings/dart/**"
+      - ".github/workflows/ci_bindings_dart.yml"
+  workflow_dispatch:
+
+env:
+  FLUTTER_VERSION: "3.27.3"
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+
+      - name: Install Flutter
+        uses: subosito/flutter-action@v2
+        with:
+          flutter-version: ${{ env.FLUTTER_VERSION }}
+          channel: 'stable'
+  
+      - name: Install flutter_rust_bridge_codegen and cargo-expand and fvm
+        working-directory: bindings/dart
+        run: |
+          set -eux -o pipefail
+          curl -L --proto '=https' --tlsv1.2 -sSf 
https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh
 | bash
+          curl -fsSL https://fvm.app/install.sh | bash
+          cargo binstall --no-confirm --no-symlinks --force cargo-expand
+          cargo binstall --no-confirm --no-symlinks --force 
flutter_rust_bridge_codegen --version "2.7.1"
+
+      - name: Generate bridge code
+        working-directory: bindings/dart
+        run: |
+          set -eux -o pipefail
+          mkdir -p lib/src/rust
+          RUST_LOG=warn flutter_rust_bridge_codegen generate
+
+      - name: Flutter pub get
+        working-directory: bindings/dart
+        run: flutter pub get
+
+      - name: build lib
+        working-directory: bindings/dart/rust
+        run: |
+          set -eux -o pipefail
+          cargo build --release

Review Comment:
   `cargo build` is enough for CI check.



##########
.github/workflows/ci_bindings_dart.yml:
##########
@@ -0,0 +1,89 @@
+# 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: Bindings Dart CI
+
+on:
+  push:
+    branches:
+      - main
+    tags:
+      - "*"
+  pull_request:
+    branches:
+      - main
+    paths:
+      - "core/**"
+      - "bindings/dart/**"
+      - ".github/workflows/ci_bindings_dart.yml"
+  workflow_dispatch:
+
+env:
+  FLUTTER_VERSION: "3.27.3"
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+
+      - name: Install Flutter
+        uses: subosito/flutter-action@v2
+        with:
+          flutter-version: ${{ env.FLUTTER_VERSION }}
+          channel: 'stable'
+  
+      - name: Install flutter_rust_bridge_codegen and cargo-expand and fvm
+        working-directory: bindings/dart
+        run: |
+          set -eux -o pipefail
+          curl -L --proto '=https' --tlsv1.2 -sSf 
https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh
 | bash
+          curl -fsSL https://fvm.app/install.sh | bash
+          cargo binstall --no-confirm --no-symlinks --force cargo-expand
+          cargo binstall --no-confirm --no-symlinks --force 
flutter_rust_bridge_codegen --version "2.7.1"
+
+      - name: Generate bridge code
+        working-directory: bindings/dart
+        run: |
+          set -eux -o pipefail
+          mkdir -p lib/src/rust
+          RUST_LOG=warn flutter_rust_bridge_codegen generate
+
+      - name: Flutter pub get
+        working-directory: bindings/dart
+        run: flutter pub get
+
+      - name: build lib
+        working-directory: bindings/dart/rust
+        run: |
+          set -eux -o pipefail
+          cargo build --release
+
+      - name: test
+        working-directory: bindings/dart
+        run: |
+          dart run lib/example.dart

Review Comment:
   What is the relationship between Flutter and Dart?



##########
bindings/dart/README.md:
##########
@@ -0,0 +1,12 @@
+# Dart binding for opendal

Review Comment:
   Hi, please follow the same template like C and Python which includes 
trademarks and license.



##########
.github/workflows/ci_bindings_dart.yml:
##########
@@ -0,0 +1,89 @@
+# 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: Bindings Dart CI
+
+on:
+  push:
+    branches:
+      - main
+    tags:
+      - "*"
+  pull_request:
+    branches:
+      - main
+    paths:
+      - "core/**"
+      - "bindings/dart/**"
+      - ".github/workflows/ci_bindings_dart.yml"
+  workflow_dispatch:
+
+env:
+  FLUTTER_VERSION: "3.27.3"
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+
+      - name: Install Flutter
+        uses: subosito/flutter-action@v2
+        with:
+          flutter-version: ${{ env.FLUTTER_VERSION }}
+          channel: 'stable'
+  
+      - name: Install flutter_rust_bridge_codegen and cargo-expand and fvm
+        working-directory: bindings/dart
+        run: |
+          set -eux -o pipefail
+          curl -L --proto '=https' --tlsv1.2 -sSf 
https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh
 | bash
+          curl -fsSL https://fvm.app/install.sh | bash
+          cargo binstall --no-confirm --no-symlinks --force cargo-expand
+          cargo binstall --no-confirm --no-symlinks --force 
flutter_rust_bridge_codegen --version "2.7.1"
+
+      - name: Generate bridge code
+        working-directory: bindings/dart
+        run: |
+          set -eux -o pipefail
+          mkdir -p lib/src/rust
+          RUST_LOG=warn flutter_rust_bridge_codegen generate

Review Comment:
   Can we assume that `flutter_rust_bridge_codegen generate` has already been 
run locally, so we only need to check the diff in CI, and developers don't need 
to run it themselves?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to