Merge pull request #34 from rahulbsw/feature/wasm-udf #129
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: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| # ==================== RUST APP ==================== | |
| rust-test: | |
| name: Rust - Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libsasl2-dev \ | |
| libssl-dev \ | |
| libzstd-dev \ | |
| libcurl4-openssl-dev \ | |
| cmake \ | |
| pkg-config \ | |
| clang \ | |
| libclang-dev | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| targets: wasm32-unknown-unknown | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: ". -> target" | |
| - name: Run tests | |
| run: cargo test --all --verbose | |
| - name: Compile Rust WebAssembly UDF examples | |
| run: >- | |
| cargo check | |
| --manifest-path udf-sdk/rust/Cargo.toml | |
| --workspace | |
| --target wasm32-unknown-unknown | |
| --locked | |
| - name: Verify checked-in WebAssembly UDF fixtures | |
| working-directory: tests/fixtures/wasm/generated | |
| run: sha256sum -c SHA256SUMS | |
| - name: Validate promoted example configs | |
| run: | | |
| cargo run --quiet --bin streamforge-validate -- examples/configs/config.example.yaml | |
| cargo run --quiet --bin streamforge-validate -- examples/redpanda/selective-replication.yaml | |
| cargo run --quiet --bin streamforge-validate -- examples/production/pii-redaction.yaml | |
| cargo run --quiet --bin streamforge-validate -- examples/production/cdc-to-datalake.yaml | |
| cargo run --quiet --bin streamforge-validate -- tests/fixtures/wasm/release-smoke.yaml | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Check formatting | |
| run: cargo fmt -- --check | |
| rust-build: | |
| name: Rust - Build (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libsasl2-dev \ | |
| libssl-dev \ | |
| libzstd-dev \ | |
| libcurl4-openssl-dev \ | |
| cmake \ | |
| pkg-config | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --release --verbose | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: streamforge-${{ matrix.os }} | |
| path: | | |
| target/release/streamforge | |
| target/release/streamforge.exe | |
| if-no-files-found: ignore | |
| rust-security: | |
| name: Rust - Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libsasl2-dev \ | |
| libssl-dev \ | |
| libzstd-dev \ | |
| cmake \ | |
| pkg-config | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit --locked | |
| - name: Run security audit | |
| # RUSTSEC-2024-0437: protobuf crash via prometheus 0.13 — no prometheus fix available yet, | |
| # only reachable from internal metrics scraper, not public-facing. | |
| run: cargo audit --ignore RUSTSEC-2024-0437 | |
| rust-benchmarks: | |
| name: Rust - Benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libsasl2-dev \ | |
| libssl-dev \ | |
| libzstd-dev \ | |
| libcurl4-openssl-dev \ | |
| cmake \ | |
| pkg-config \ | |
| clang \ | |
| libclang-dev | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build benchmarks | |
| run: cargo bench --no-run | |
| # ==================== OPERATOR ==================== | |
| operator-test: | |
| name: Operator - Test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: operator | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "operator -> target" | |
| - name: Run tests | |
| run: cargo test --verbose | |
| - name: Run clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: Check formatting | |
| run: cargo fmt -- --check | |
| operator-build: | |
| name: Operator - Build Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build operator Docker image | |
| run: docker build -f operator/Dockerfile -t streamforge-operator:test . | |
| # ==================== UI ==================== | |
| ui-test: | |
| name: UI - Test & Lint | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ui | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: ui/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Type check | |
| run: npm run type-check | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| env: | |
| NODE_ENV: production | |
| ui-build: | |
| name: UI - Build Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build UI Docker image | |
| run: docker build -f ui/Dockerfile -t streamforge-ui:test ui | |
| # ==================== HELM ==================== | |
| helm-validate: | |
| name: Helm - Validate Chart | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: 'latest' | |
| - name: Lint Helm chart | |
| run: helm lint helm/streamforge-operator | |
| - name: Template Helm chart | |
| run: | | |
| helm template streamforge helm/streamforge-operator \ | |
| --set operator.image.repository=test \ | |
| --set operator.image.tag=test \ | |
| > /dev/null |