feat(community): add typed DML generation #45
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: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| rust: | |
| name: Rust | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2 | |
| - name: Install Linux keyring dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config | |
| - uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 | |
| with: | |
| toolchain: stable | |
| components: clippy,rustfmt | |
| - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2.8.1 | |
| - name: Format | |
| run: cargo fmt --all --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --exclude chat2db-desktop --all-targets --all-features --locked -- -D warnings | |
| - name: Test | |
| run: cargo test --workspace --exclude chat2db-desktop --locked | |
| - name: Process supervisor tests | |
| run: cargo test -p chat2db-java-bridge --features test-fixture --test supervisor --locked | |
| rust-msrv: | |
| name: Rust 1.88 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2 | |
| - name: Install Linux keyring dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config | |
| - uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 | |
| with: | |
| toolchain: 1.88.0 | |
| - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2.8.1 | |
| with: | |
| shared-key: msrv | |
| - name: Check minimum supported Rust version | |
| run: cargo check --workspace --exclude chat2db-desktop --all-targets --all-features --locked | |
| java: | |
| name: Java | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2 | |
| - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.7.1 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| cache: maven | |
| cache-dependency-path: | | |
| java/pom.xml | |
| java/compat-runtime/pom.xml | |
| - name: Verify tests and driver isolation | |
| working-directory: java | |
| run: ./mvnw -B clean verify | |
| ipc-integration: | |
| name: Rust-Java IPC | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2 | |
| with: | |
| submodules: recursive | |
| - name: Install Linux keyring dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config | |
| - uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2.8.1 | |
| - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.7.1 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| cache: maven | |
| cache-dependency-path: | | |
| java/pom.xml | |
| java/compat-runtime/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-bom/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-spi/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-api/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-mysql/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-h2/pom.xml | |
| - name: Package Java engine | |
| working-directory: java | |
| run: ./mvnw -B -DskipTests package | |
| - name: Verify Rust-Java process protocol | |
| env: | |
| CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar" | |
| CHAT2DB_H2_DRIVER_JAR: "${{ github.workspace }}/java/compat-runtime/target/test-drivers/h2-2.3.232.jar" | |
| run: cargo test -p chat2db-java-bridge --features java-integration --test java_engine --locked | |
| - name: Verify H2 JDBC vertical slice | |
| env: | |
| CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar" | |
| CHAT2DB_H2_DRIVER_JAR: "${{ github.workspace }}/java/compat-runtime/target/test-drivers/h2-2.3.232.jar" | |
| run: cargo test -p chat2db-java-bridge --features java-integration --test java_jdbc_h2 --locked | |
| - name: Verify fixed Community H2 classpath reproducibility | |
| run: ./scripts/verify-community-h2-reproducibility.sh | |
| - name: Verify configured Community Java DML adapter | |
| working-directory: java | |
| env: | |
| CHAT2DB_COMMUNITY_CLASSPATH_DIR: "${{ github.workspace }}/target/community-h2-classpath" | |
| CHAT2DB_COMMUNITY_SOURCE_COMMIT: "f63cbf4a8334b45d9b1fbb268116e4dfc1fad1d7" | |
| run: >- | |
| ./mvnw -B -pl compat-runtime | |
| -Dtest='CommunityPluginRegistryTest#realCommunityH2BuildsAndExecutesBoundedDml,CommunityPluginRegistryTest#realCommunityMysqlRejectsBackslashCrossColumnInjection,CommunityPluginRegistryTest#realCommunityMysqlNormalizesBooleanAliasesAndBits,JdbcProtocolLoopTest#communityDmlDispatchDoesNotRequireAJdbcSession' | |
| test | |
| - name: Verify real Community H2 SPI vertical slice | |
| env: | |
| CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar" | |
| CHAT2DB_H2_DRIVER_JAR: "${{ github.workspace }}/java/compat-runtime/target/test-drivers/h2-2.3.232.jar" | |
| CHAT2DB_COMMUNITY_CLASSPATH_DIR: "${{ github.workspace }}/target/community-h2-classpath" | |
| run: cargo test -p chat2db-java-bridge --features java-integration --test java_community_h2 --locked | |
| - name: Verify Community H2 product service boundary | |
| env: | |
| CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar" | |
| CHAT2DB_H2_DRIVER_JAR: "${{ github.workspace }}/java/compat-runtime/target/test-drivers/h2-2.3.232.jar" | |
| CHAT2DB_COMMUNITY_CLASSPATH_DIR: "${{ github.workspace }}/target/community-h2-classpath" | |
| run: cargo test -p chat2db-core --features java-integration --test java_community_product --locked | |
| - name: Verify product H2 vertical slice | |
| env: | |
| CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar" | |
| CHAT2DB_H2_DRIVER_JAR: "${{ github.workspace }}/java/compat-runtime/target/test-drivers/h2-2.3.232.jar" | |
| run: cargo test -p chat2db-core --features java-integration --test java_h2_product --locked | |
| contracts: | |
| name: Generated contracts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2 | |
| - name: Install Linux keyring dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config | |
| - uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2.8.1 | |
| with: | |
| shared-key: contracts | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: "22.22.2" | |
| cache: npm | |
| cache-dependency-path: apps/frontend/package-lock.json | |
| - name: Install frontend generator | |
| working-directory: apps/frontend | |
| run: npm ci | |
| - name: Verify generated OpenAPI and TypeScript | |
| run: ./scripts/check-contracts.sh | |
| frontend: | |
| name: Frontend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: "22.22.2" | |
| cache: npm | |
| cache-dependency-path: apps/frontend/package-lock.json | |
| - name: Install | |
| working-directory: apps/frontend | |
| run: npm ci | |
| - name: Typecheck | |
| working-directory: apps/frontend | |
| run: npm run typecheck | |
| - name: Test | |
| working-directory: apps/frontend | |
| run: npm test | |
| - name: Build | |
| working-directory: apps/frontend | |
| run: npm run build | |
| desktop: | |
| name: Desktop (${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2 | |
| - name: Install Linux desktop dependencies | |
| if: runner.os == 'Linux' | |
| run: >- | |
| sudo apt-get update && sudo apt-get install -y | |
| libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev | |
| libssl-dev libayatana-appindicator3-dev librsvg2-dev libdbus-1-dev | |
| pkg-config | |
| - uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 | |
| with: | |
| toolchain: 1.88.0 | |
| components: clippy | |
| - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2.8.1 | |
| with: | |
| shared-key: desktop-${{ matrix.os }} | |
| - name: Test local storage | |
| run: cargo test -p chat2db-storage --locked | |
| - name: Test local attachment | |
| run: cargo test -p chat2db-local --locked | |
| - name: Test Windows Java bridge path contracts | |
| if: runner.os == 'Windows' | |
| run: cargo test -p chat2db-java-bridge --lib --locked | |
| - name: Initialize fixed Community source on Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| git config --global core.longpaths true | |
| git config --global core.autocrlf false | |
| git submodule update --init --recursive third_party/chat2db-community | |
| - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.7.1 | |
| if: runner.os == 'Windows' | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| cache: maven | |
| cache-dependency-path: | | |
| java/pom.xml | |
| java/compat-runtime/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-bom/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-spi/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-api/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-mysql/pom.xml | |
| third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-h2/pom.xml | |
| - name: Package Java engine for Windows managed-driver test | |
| if: runner.os == 'Windows' | |
| working-directory: java | |
| shell: pwsh | |
| run: .\mvnw.cmd -B -DskipTests package | |
| - name: Verify Windows managed H2 driver lifecycle | |
| if: runner.os == 'Windows' | |
| env: | |
| CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar" | |
| CHAT2DB_H2_DRIVER_JAR: "${{ github.workspace }}/java/compat-runtime/target/test-drivers/h2-2.3.232.jar" | |
| run: >- | |
| cargo test -p chat2db-core --features java-integration | |
| --test java_h2_product --locked | |
| - name: Build fixed Community H2 compatibility classpath on Windows | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: ./scripts/build-community-h2-classpath.sh | |
| - name: Verify Windows real Community H2 SPI vertical slice | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| env: | |
| CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar" | |
| CHAT2DB_H2_DRIVER_JAR: "${{ github.workspace }}/java/compat-runtime/target/test-drivers/h2-2.3.232.jar" | |
| CHAT2DB_COMMUNITY_CLASSPATH_DIR: "${{ github.workspace }}/target/community-h2-classpath" | |
| run: >- | |
| cargo test -p chat2db-java-bridge --features java-integration | |
| --test java_community_h2 --locked | |
| - name: Verify Windows Community H2 product service boundary | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| env: | |
| CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar" | |
| CHAT2DB_H2_DRIVER_JAR: "${{ github.workspace }}/java/compat-runtime/target/test-drivers/h2-2.3.232.jar" | |
| CHAT2DB_COMMUNITY_CLASSPATH_DIR: "${{ github.workspace }}/target/community-h2-classpath" | |
| run: >- | |
| cargo test -p chat2db-core --features java-integration | |
| --test java_community_product --locked | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: "22.22.2" | |
| cache: npm | |
| cache-dependency-path: apps/frontend/package-lock.json | |
| - name: Build shared frontend | |
| working-directory: apps/frontend | |
| run: npm ci && npm run build | |
| - name: Test desktop adapter | |
| run: cargo test -p chat2db-desktop --locked | |
| - name: Lint desktop adapter | |
| run: cargo clippy -p chat2db-desktop --all-targets --features custom-protocol --locked -- -D warnings | |
| - name: Compile Tauri custom protocol | |
| run: cargo check -p chat2db-desktop --all-targets --features custom-protocol --locked |