ffi: drop orphan type stubs #52
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: Test | |
| on: [push, pull_request] | |
| jobs: | |
| # Unit-only run: server-dependent and embedded testsets self-skip when | |
| # their prerequisites aren't available. Matrix across the compat range | |
| # (1.9 LTS) and current stable to catch version-skew regressions. | |
| test-unit: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| julia-version: ['1.9', '1'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.julia-version }} | |
| - uses: julia-actions/cache@v2 | |
| - uses: julia-actions/julia-runtest@v1 | |
| - uses: julia-actions/julia-processcoverage@v1 | |
| if: matrix.julia-version == '1' | |
| - uses: codecov/codecov-action@v4 | |
| if: matrix.julia-version == '1' | |
| with: | |
| files: lcov.info | |
| fail_ci_if_error: false | |
| # Matrix across SurrealDB server versions to catch version-skew bugs. | |
| # `latest` floats; the pinned tags lock in v2.x and v3.x lineages. | |
| test-remote: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| surreal-image: | |
| - surrealdb/surrealdb:v2 | |
| - surrealdb/surrealdb:latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: '1' | |
| - uses: julia-actions/cache@v2 | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| - name: Instantiate test env | |
| run: julia --project=test -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' | |
| - name: Start SurrealDB (${{ matrix.surreal-image }}) | |
| run: | | |
| docker run -d -p 8000:8000 \ | |
| --name surrealdb \ | |
| -e SURREAL_LOG=debug \ | |
| -e RUST_LOG=surrealdb=debug,surrealdb_server=debug \ | |
| ${{ matrix.surreal-image }} \ | |
| start --user root --pass root --log debug memory | |
| - name: Wait for SurrealDB | |
| run: | | |
| for i in $(seq 1 30); do | |
| curl -s -X POST http://localhost:8000/rpc \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"id":1,"method":"version","params":[]}' && break | |
| sleep 1 | |
| done | |
| - name: Run remote tests | |
| run: julia --project=test test/runtests.jl | |
| env: | |
| SURREALDB_URL: ws://localhost:8000 | |
| - name: Docker logs (always — needed on cancellation too) | |
| if: always() | |
| run: docker logs surrealdb 2>&1 | tail -200 | |
| # Embedded matrix: linux x86_64 (glibc) and macos arm64 (libSystem). | |
| # The s2 audit hit an ARM64-only `sr_object_keys` FFI bug — having | |
| # macos-latest in the matrix catches that bug class on every PR. | |
| test-embedded: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 25 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: '1' | |
| - uses: julia-actions/cache@v2 | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| - name: Instantiate test env | |
| run: julia --project=test -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| # Cache only cargo's own dirs, NOT /tmp/surrealdb.c/target — the | |
| # latter caused build failures when the cache restored the target | |
| # directory without the source tree, defeating the `if [ ! -d ]` | |
| # guard. Cargo's own build cache is enough. | |
| - name: Cache cargo registries | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: cargo-registry-${{ runner.os }} | |
| - name: Build libsurreal | |
| run: | | |
| # Always re-clone to a deterministic state (--depth 1 is cheap). | |
| rm -rf /tmp/surrealdb.c | |
| git clone https://github.com/surrealdb/surrealdb.c.git --depth 1 /tmp/surrealdb.c | |
| cd /tmp/surrealdb.c | |
| cargo build --release | |
| # Each platform produces a different filename; copy whichever exists. | |
| cp target/release/libsurrealdb_c.so ${RUNNER_TEMP}/libsurreal.lib 2>/dev/null || \ | |
| cp target/release/libsurrealdb_c.dylib ${RUNNER_TEMP}/libsurreal.lib 2>/dev/null || \ | |
| cp target/release/surrealdb_c.dll ${RUNNER_TEMP}/libsurreal.lib | |
| env: | |
| CARGO_PROFILE_RELEASE_DEBUG: 0 | |
| - name: Run full suite (embedded loaded via SURREALDB_LIB) | |
| run: julia --project=test test/runtests.jl | |
| env: | |
| SURREALDB_LIB: ${{ runner.temp }}/libsurreal.lib |