Release v11.0.0 #31
Workflow file for this run
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | name: Connectors CI/CD | |
| on: | |
| pull_request: | |
| branches-ignore: | |
| - rc-** | |
| workflow_dispatch: | |
| jobs: | |
| detect-targets: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| modified_targets: ${{ steps.filter.outputs.modified_targets }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 | |
| - name: Detect modified targets | |
| id: filter | |
| run: | | |
| MODIFIED_TARGETS=() | |
| # Ensure HEAD^ exists | |
| if git rev-parse --verify HEAD^ >/dev/null 2>&1; then | |
| BASE_COMMIT="HEAD^" | |
| else | |
| BASE_COMMIT=$(git rev-list --max-parents=0 HEAD) # First commit | |
| fi | |
| # Check each client dynamically | |
| for client in src/*; do | |
| CLIENT_NAME=$(basename "$client") | |
| [ -d "$client" ] || continue | |
| if ! git diff --quiet "$BASE_COMMIT" HEAD -- "$client"; then | |
| echo "Changes detected in $CLIENT_NAME" | |
| MODIFIED_TARGETS+=("$CLIENT_NAME") | |
| fi | |
| done | |
| # Convert to JSON array format | |
| MODIFIED_TARGETS_JSON=$(printf '%s\n' "${MODIFIED_TARGETS[@]}" | jq -R -s -c 'split("\n") | map(select(. != ""))') | |
| echo "Detected modified targets: $MODIFIED_TARGETS_JSON" | |
| echo "modified_targets=$MODIFIED_TARGETS_JSON" >> $GITHUB_ENV | |
| echo "::set-output name=modified_targets::$MODIFIED_TARGETS_JSON" | |
| build-target: | |
| runs-on: ubuntu-latest | |
| needs: detect-targets | |
| if: ${{ needs.detect-targets.outputs.modified_targets != '[]' }} | |
| strategy: | |
| matrix: | |
| target: ${{ fromJson(needs.detect-targets.outputs.modified_targets) }} | |
| rust-version: [1.86.0] | |
| max-parallel: 1 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Rust ${{ matrix.rust-version }} | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.rust-version }} | |
| components: rustfmt, clippy | |
| rustflags: "" | |
| - name: Cache cargo registry & build | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Format Check | |
| run: | | |
| if [ -d "examples/${{ matrix.target }}" ]; then \ | |
| find examples/${{ matrix.target }} -name "*.rs" -exec rustfmt --check -- {} +; \ | |
| fi | |
| if [ -d "src/${{ matrix.target }}" ]; then \ | |
| find src/${{ matrix.target }} -name "*.rs" -exec rustfmt --check -- {} +; \ | |
| fi | |
| - name: Lint Check | |
| run: cargo clippy --all-targets $( [ "${{ matrix.target }}" = "common" ] || echo "--features ${{ matrix.target }}" ) | |
| - name: Test | |
| run: cargo test $( [ "${{ matrix.target }}" = "common" ] || echo "--features ${{ matrix.target }} ${{ matrix.target }}" ) |