feat(kafka): kafka api command. #19
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
| # Copyright 2023 RobustMQ Team | |
| # | |
| # 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: Ig All Test | |
| on: | |
| push: | |
| paths-ignore: | |
| - "docs/**" | |
| - "**.md" | |
| - ".github/ISSUE_TEMPLATE/**" | |
| - ".github/pull_request_template.md" | |
| pull_request: | |
| paths-ignore: | |
| - "docs/**" | |
| - "**.md" | |
| - ".github/ISSUE_TEMPLATE/**" | |
| - ".github/pull_request_template.md" | |
| # Cancel previous runs if a new commit is pushed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| CARGO_BUILD_JOBS: 8 | |
| jobs: | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler cmake | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@nextest | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "integration-tests" | |
| cache-on-failure: true | |
| # Allow all branches to save cache for faster PR iterations | |
| # save-if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }} | |
| # Cache key includes Cargo.lock to ensure cache invalidation when dependencies change | |
| key: ${{ hashFiles('**/Cargo.lock') }} | |
| # Additional cache for compiled binaries | |
| # Only invalidate when Cargo.lock changes (dependencies change) | |
| # Source code changes will use incremental compilation | |
| - name: Cache compiled binaries | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| target/debug/broker-server | |
| target/debug/deps | |
| target/debug/build | |
| target/debug/.fingerprint | |
| target/debug/incremental | |
| # Key only on Cargo.lock - source changes use incremental compilation | |
| key: binaries-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| binaries-${{ runner.os }}- | |
| - name: Check cache status | |
| run: | | |
| echo "==========================================" | |
| echo "Cache Status Check" | |
| echo "==========================================" | |
| if [ -f "target/debug/broker-server" ]; then | |
| echo "✅ Binary cache HIT - broker-server exists" | |
| echo " Size: $(du -h target/debug/broker-server | cut -f1)" | |
| echo " Modified: $(stat -c '%y' target/debug/broker-server 2>/dev/null || stat -f '%Sm' target/debug/broker-server)" | |
| echo "" | |
| echo "Expected: Incremental compilation (fast)" | |
| else | |
| echo "❌ Binary cache MISS - fresh build required" | |
| echo "" | |
| echo "Expected: Full compilation (slow)" | |
| fi | |
| # Check incremental cache | |
| if [ -d "target/debug/incremental" ]; then | |
| INCREMENTAL_SIZE=$(du -sh target/debug/incremental 2>/dev/null | cut -f1 || echo "0") | |
| echo " Incremental cache: $INCREMENTAL_SIZE" | |
| fi | |
| echo "==========================================" | |
| - name: Run integration tests with broker | |
| run: | | |
| echo "## 🧪 Integration Test Results" >> $GITHUB_STEP_SUMMARY | |
| if make ig-test-ci; then | |
| echo "✅ All tests passed!" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Tests failed" >> $GITHUB_STEP_SUMMARY | |
| exit 1 | |
| fi |