refactor(redis): cluster scan use SCAN instead of KEYS; fix rename/sa… #40
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: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| # Fast smoke tests run first to fail fast | |
| smoke: | |
| name: Smoke Tests (typecheck, lint, unit) | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.10" | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install frontend dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run smoke tests | |
| run: bun run typecheck && bun run lint && bun run test:unit && bun run test:service | |
| rust-check: | |
| name: Rust Check | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Cache Rust build artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> src-tauri/target | |
| - name: Run rust check | |
| run: cargo check --manifest-path src-tauri/Cargo.toml --all-targets | |
| # Parallel database integration tests | |
| integration: | |
| name: Integration Tests (${{ matrix.database }}) | |
| runs-on: ubuntu-22.04 | |
| needs: [smoke, rust-check] | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| database: | |
| - mysql | |
| - postgres | |
| - mariadb | |
| - clickhouse | |
| - mssql | |
| - sqlite | |
| - duckdb | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.10" | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install frontend dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust build artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> src-tauri/target | |
| key: ${{ matrix.database }} | |
| - name: Run ${{ matrix.database }} integration tests | |
| run: IT_DB=${{ matrix.database }} bun run test:integration | |
| - name: Docker diagnostics on failure | |
| if: failure() | |
| run: | | |
| echo "==== docker ps -a ====" | |
| docker ps -a || true | |
| echo "==== Container logs ====" | |
| docker ps -aq | xargs -I {} sh -c 'echo "--- Container {} ---" && docker logs {} 2>&1 | tail -50' || true | |
| # Summary job to check all tests passed | |
| ci-success: | |
| name: CI Success | |
| runs-on: ubuntu-22.04 | |
| needs: [smoke, rust-check, integration] | |
| if: always() | |
| steps: | |
| - name: Check all jobs succeeded | |
| run: | | |
| if [ "${{ needs.smoke.result }}" != "success" ]; then | |
| echo "Smoke tests failed" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.rust-check.result }}" != "success" ]; then | |
| echo "Rust check failed" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.integration.result }}" != "success" ]; then | |
| echo "Integration tests failed" | |
| exit 1 | |
| fi | |
| echo "All CI checks passed!" |