Add dedicated @surrealdb/sqon package & add type-safe JSON format #562
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: Check | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_call: | |
| permissions: | |
| contents: read | |
| checks: write | |
| jobs: | |
| quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.2.21 | |
| - name: Code Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Checking Code Quality | |
| run: bun run qc | |
| typecheck: | |
| name: Typecheck | |
| needs: build-sdk | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| typescript: ["~5.8.0", "~6.0.0"] | |
| steps: | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.2.21 | |
| - name: Code Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Download SDK build | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: sdk-build | |
| path: packages/sdk/dist/ | |
| - name: Install TypeScript ${{ matrix.typescript }} | |
| run: bun add --dev typescript@${{ matrix.typescript }} | |
| - name: Typecheck SDK types | |
| run: bunx tsc --noEmit --project packages/tests/typecheck/tsconfig.json | |
| build-sdk: | |
| name: Build SDK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.2.21 | |
| - name: Code Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Cache turbo | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: .turbo/cache | |
| key: turbo-sdk-${{ runner.os }}-${{ hashFiles('bun.lock') }}-${{ hashFiles('packages/sdk/src/**') }} | |
| restore-keys: turbo-sdk-${{ runner.os }}-${{ hashFiles('bun.lock') }}- | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build SDK | |
| run: bun run build:sdk | |
| - name: Upload SDK artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: sdk-build | |
| retention-days: 1 | |
| path: packages/sdk/dist/ | |
| # build-wasm: | |
| # name: Build WASM | |
| # needs: build-sdk | |
| # runs-on: runner-amd64-2xlarge | |
| # steps: | |
| # - name: Install Bun | |
| # uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| # with: | |
| # bun-version: 1.2.21 | |
| # - name: Code Checkout | |
| # uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| # - name: Install Rust | |
| # uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| # with: | |
| # toolchain: stable | |
| # targets: wasm32-unknown-unknown | |
| # - name: Cache Rust | |
| # uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 | |
| # with: | |
| # shared-key: wasm | |
| # workspaces: packages/wasm | |
| # - name: Install wasm-bindgen-cli | |
| # run: command -v wasm-bindgen && wasm-bindgen --version | grep -q 0.2.108 || cargo install -f wasm-bindgen-cli --version 0.2.108 | |
| # - name: Install wasm-opt | |
| # run: command -v wasm-opt || cargo install wasm-opt | |
| # - name: Cache turbo | |
| # uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| # with: | |
| # path: .turbo/cache | |
| # key: turbo-wasm-${{ runner.os }}-${{ hashFiles('bun.lock') }}-${{ hashFiles('packages/wasm/src-rust/**', 'packages/wasm/src-ts/**', 'packages/wasm/Cargo.toml') }} | |
| # restore-keys: turbo-wasm-${{ runner.os }}-${{ hashFiles('bun.lock') }}- | |
| # - name: Install dependencies | |
| # run: bun install | |
| # - name: Download SDK build | |
| # uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| # with: | |
| # name: sdk-build | |
| # path: packages/sdk/dist/ | |
| # - name: Build WASM | |
| # run: bun run build:wasm | |
| # - name: Upload WASM artifacts | |
| # uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| # with: | |
| # name: wasm-build | |
| # retention-days: 30 | |
| # path: | | |
| # packages/wasm/dist/ | |
| # packages/wasm/wasm/ | |
| build-node: | |
| name: Build Node | |
| needs: build-sdk | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.2.21 | |
| - name: Code Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| with: | |
| toolchain: stable | |
| - name: Cache Rust | |
| uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 | |
| with: | |
| shared-key: node | |
| workspaces: packages/node | |
| - name: Cache turbo | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: .turbo/cache | |
| key: turbo-node-${{ runner.os }}-${{ hashFiles('bun.lock') }}-${{ hashFiles('packages/node/src-rust/**', 'packages/node/src-ts/**', 'packages/node/Cargo.toml') }} | |
| restore-keys: turbo-node-${{ runner.os }}-${{ hashFiles('bun.lock') }}- | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Download SDK build | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: sdk-build | |
| path: packages/sdk/dist/ | |
| - name: Build Node | |
| run: bun run build:node | |
| - name: Upload Node artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: node-build | |
| retention-days: 30 | |
| path: packages/node/dist/ | |
| test: | |
| name: Test | |
| needs: build-sdk | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| surrealdb: ["v2.2.7", "v2.3.7", "v3.0.0", "nightly"] | |
| engine: ["ws", "http"] | |
| steps: | |
| - name: Install SurrealDB ${{ matrix.surrealdb }} over ${{ matrix.engine }} engine | |
| run: | | |
| if [ "${{ matrix.surrealdb }}" = "nightly" ]; then | |
| curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --nightly | |
| else | |
| curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --version ${{ matrix.surrealdb }} | |
| fi | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.2.21 | |
| - name: Code Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Download SDK build | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: sdk-build | |
| path: packages/sdk/dist/ | |
| - name: Run tests | |
| run: cd packages/tests && bun test --preload ./global.ts --reporter=junit --reporter-outfile=junit.xml | |
| env: | |
| SURREAL_PROTOCOL: ${{ matrix.engine }} | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@49b2ca06f62aa7ef83ae6769a2179271e160d8e4 # v6.3.1 | |
| if: success() || failure() | |
| with: | |
| report_paths: packages/tests/junit.xml | |
| check_name: Test Report (${{ matrix.surrealdb }} / ${{ matrix.engine }}) | |
| detailed_summary: true | |
| include_passed: false | |
| include_skipped: false | |
| group_suite: true | |
| skip_success_summary: true | |
| # test-wasm: | |
| # name: Test WASM | |
| # needs: build-wasm | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - name: Install Bun | |
| # uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| # with: | |
| # bun-version: 1.2.21 | |
| # - name: Code Checkout | |
| # uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| # - name: Install dependencies | |
| # run: bun install | |
| # - name: Download SDK build | |
| # uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| # with: | |
| # name: sdk-build | |
| # path: packages/sdk/dist/ | |
| # - name: Download WASM build | |
| # uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| # with: | |
| # name: wasm-build | |
| # path: packages/wasm/ | |
| # - name: Run WASM tests | |
| # run: cd packages/tests && SURREAL_BACKEND=wasm bun test --preload ./global-wasm.ts --reporter=junit --reporter-outfile=junit.xml | |
| # - name: Publish Test Report | |
| # uses: mikepenz/action-junit-report@49b2ca06f62aa7ef83ae6769a2179271e160d8e4 # v6.3.1 | |
| # if: success() || failure() | |
| # with: | |
| # report_paths: packages/tests/junit.xml | |
| # check_name: Test Report (WASM) | |
| # detailed_summary: true | |
| # include_passed: false | |
| # include_skipped: false | |
| # group_suite: true | |
| # skip_success_summary: true | |
| test-node: | |
| name: Test Node | |
| needs: build-node | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.2.21 | |
| - name: Code Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Download SDK build | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: sdk-build | |
| path: packages/sdk/dist/ | |
| - name: Download Node build | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: node-build | |
| path: packages/node/dist/ | |
| - name: Run Node tests | |
| run: cd packages/tests && SURREAL_BACKEND=node bun test --preload ./global-node.ts --reporter=junit --reporter-outfile=junit.xml | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@49b2ca06f62aa7ef83ae6769a2179271e160d8e4 # v6.3.1 | |
| if: success() || failure() | |
| with: | |
| report_paths: packages/tests/junit.xml | |
| check_name: Test Report (Node) | |
| detailed_summary: true | |
| include_passed: false | |
| include_skipped: false | |
| group_suite: true | |
| skip_success_summary: true |