Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl engine for js sdk 1.0 #38

Merged
merged 38 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ead3e6a
wip
RaphaelDarley Jun 24, 2024
3ce700b
wip
RaphaelDarley Jun 24, 2024
1a9e2c8
wip
RaphaelDarley Jun 24, 2024
5bddaed
wip
RaphaelDarley Jun 24, 2024
f495474
fix build
RaphaelDarley Jun 25, 2024
c735da3
remove bsd support
RaphaelDarley Jun 25, 2024
2e78b01
run ci on pr
RaphaelDarley Jun 25, 2024
d6318f0
fix
RaphaelDarley Jun 25, 2024
e9aed5a
fix tsc in ci
RaphaelDarley Jun 25, 2024
04bde7c
update to 2.0 alpha
RaphaelDarley Jun 25, 2024
8bf3542
remove typescript from lock
RaphaelDarley Jun 25, 2024
07425f8
switch tsc to npm
RaphaelDarley Jun 25, 2024
8a3bca3
add debug
RaphaelDarley Jun 25, 2024
60018bf
rename tsc target
RaphaelDarley Jun 25, 2024
60bc448
debug
RaphaelDarley Jun 25, 2024
d03c4c2
debug
RaphaelDarley Jun 25, 2024
1f61676
remove rocksdb support
RaphaelDarley Jun 25, 2024
21b4524
fix tests
RaphaelDarley Jun 25, 2024
a47cfc2
fix tests
RaphaelDarley Jun 25, 2024
ce7c0ef
disable version check
RaphaelDarley Jun 25, 2024
74a94f4
attempt to fix aarm64 linux musl
RaphaelDarley Jun 25, 2024
afe62d6
fix ci
RaphaelDarley Jun 25, 2024
5ca3dd8
remove arm linux musl
RaphaelDarley Jun 25, 2024
c90b661
fix ci
RaphaelDarley Jun 25, 2024
0302490
fix
RaphaelDarley Jun 25, 2024
f99f87b
add tsc
RaphaelDarley Jun 25, 2024
90fd4a1
add options
RaphaelDarley Jun 26, 2024
ea7078b
add skv
RaphaelDarley Jun 26, 2024
e6fdee5
remove failing tests
RaphaelDarley Jun 26, 2024
5399395
fix close panic
RaphaelDarley Jun 26, 2024
b8369e6
debug
RaphaelDarley Jun 26, 2024
c376c7c
debug
RaphaelDarley Jun 26, 2024
9e62fd9
edit tests
RaphaelDarley Jun 26, 2024
6d748b4
update ci
RaphaelDarley Jun 26, 2024
c90b017
fix build cmd
RaphaelDarley Jun 26, 2024
cd02f50
fix
RaphaelDarley Jun 26, 2024
1f4b1df
fix
RaphaelDarley Jun 26, 2024
ca98ee1
bump version
RaphaelDarley Jun 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[build]
rustflags = ["--cfg", "surrealdb_unstable", ]

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
269 changes: 159 additions & 110 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,29 @@ on:
- '**/*.gitignore'
- .editorconfig
- docs/**
pull_request: null
pull_request:
branches: ["main"]
jobs:
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
- host: macos-13
target: x86_64-apple-darwin
build: |
yarn build
yarn build --target x86_64-apple-darwin
strip -x *.node
- host: windows-latest
build: yarn build
target: x86_64-pc-windows-msvc
- host: windows-latest
build: |
yarn build --target i686-pc-windows-msvc
yarn build
yarn test
target: i686-pc-windows-msvc
target: x86_64-pc-windows-msvc
# - host: windows-latest
# build: |
# yarn build --target i686-pc-windows-msvc
# yarn test
# target: i686-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
Expand Down Expand Up @@ -77,19 +80,24 @@ jobs:
build: |
yarn build --target aarch64-linux-android
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
- host: ubuntu-latest
target: armv7-linux-androideabi
build: |
yarn build --target armv7-linux-androideabi
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
rustup target add aarch64-unknown-linux-musl &&
yarn build --target aarch64-unknown-linux-musl &&
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
# - host: ubuntu-latest
# target: armv7-linux-androideabi
# build: |
# yarn build --target armv7-linux-androideabi
# ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
# - host: ubuntu-latest
# target: aarch64-unknown-linux-musl
# docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
# build: |-
# set -e &&
# rustup target add aarch64-unknown-linux-musl &&
# yarn build --target aarch64-unknown-linux-musl &&
# /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
# - host: [self-hosted, linux, ARM64]
# target: aarch64-unknown-linux-musl
# build: rustup target add aarch64-unknown-linux-musl &&
# yarn build --target aarch64-unknown-linux-musl &&
# /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
# - host: windows-latest
# target: aarch64-pc-windows-msvc
# build: yarn build --target aarch64-pc-windows-msvc
Expand Down Expand Up @@ -161,54 +169,54 @@ jobs:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
build-freebsd:
runs-on: macos-12
name: Build FreeBSD
steps:
- uses: actions/checkout@v3
- name: Build
id: build
uses: vmactions/freebsd-vm@v0
env:
DEBUG: napi:*
RUSTUP_HOME: /usr/local/rustup
CARGO_HOME: /usr/local/cargo
RUSTUP_IO_THREADS: 1
with:
envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS
usesh: true
mem: 3000
prepare: |
pkg install -y -f curl node libnghttp2 npm yarn
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain beta
export PATH="/usr/local/cargo/bin:$PATH"
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ node -v ~~~~"
node -v
echo "~~~~ yarn --version ~~~~"
yarn --version
run: |
export PATH="/usr/local/cargo/bin:$PATH"
pwd
ls -lah
whoami
env
freebsd-version
yarn install
yarn build
strip -x *.node
yarn test
rm -rf node_modules
rm -rf target
rm -rf .yarn/cache
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: bindings-freebsd
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
# build-freebsd:
# runs-on: macos-12
# name: Build FreeBSD
# steps:
# - uses: actions/checkout@v3
# - name: Build
# id: build
# uses: vmactions/freebsd-vm@v0
# env:
# DEBUG: napi:*
# RUSTUP_HOME: /usr/local/rustup
# CARGO_HOME: /usr/local/cargo
# RUSTUP_IO_THREADS: 1
# with:
# envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS
# usesh: true
# mem: 3000
# prepare: |
# pkg install -y -f curl node libnghttp2 npm yarn
# curl https://sh.rustup.rs -sSf --output rustup.sh
# sh rustup.sh -y --profile minimal --default-toolchain beta
# export PATH="/usr/local/cargo/bin:$PATH"
# echo "~~~~ rustc --version ~~~~"
# rustc --version
# echo "~~~~ node -v ~~~~"
# node -v
# echo "~~~~ yarn --version ~~~~"
# yarn --version
# run: |
# export PATH="/usr/local/cargo/bin:$PATH"
# pwd
# ls -lah
# whoami
# env
# freebsd-version
# yarn install
# yarn build
# strip -x *.node
# yarn test
# rm -rf node_modules
# rm -rf target
# rm -rf .yarn/cache
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: bindings-freebsd
# path: ${{ env.APP_NAME }}.*.node
# if-no-files-found: error
test-macOS-windows-binding:
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
needs:
Expand All @@ -218,11 +226,11 @@ jobs:
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
target: aarch64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
node:
- '14'
# - '14'
- '16'
- '18'
runs-on: ${{ matrix.settings.host }}
Expand Down Expand Up @@ -286,7 +294,7 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
# - '14'
- '16'
- '18'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -320,8 +328,8 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
- '16'
# - '14'
# - '16'
- '18'
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -353,39 +361,39 @@ jobs:
set -e
yarn test
ls -la
test-linux-aarch64-musl-binding:
name: Test bindings on aarch64-unknown-linux-musl - node@${{ matrix.node }}
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: bindings-aarch64-unknown-linux-musl
path: .
- name: List packages
run: ls -R .
shell: bash
- name: Install dependencies
run: |
yarn config set supportedArchitectures.cpu "arm64"
yarn config set supportedArchitectures.libc "musl"
yarn install
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Setup and run tests
uses: addnab/docker-run-action@v3
with:
image: node:lts-alpine
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
run: |
set -e
yarn test
# test-linux-aarch64-musl-binding:
# name: Test bindings on aarch64-unknown-linux-musl - node@${{ matrix.node }}
# needs:
# - build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Download artifacts
# uses: actions/download-artifact@v3
# with:
# name: bindings-aarch64-unknown-linux-musl
# path: .
# - name: List packages
# run: ls -R .
# shell: bash
# - name: Install dependencies
# run: |
# yarn config set supportedArchitectures.cpu "arm64"
# yarn config set supportedArchitectures.libc "musl"
# yarn install
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# with:
# platforms: arm64
# - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# - name: Setup and run tests
# uses: addnab/docker-run-action@v3
# with:
# image: node:lts-alpine
# options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
# run: |
# set -e
# yarn test
# test-linux-arm-gnueabihf-binding:
# name: Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }}
# needs:
Expand Down Expand Up @@ -446,11 +454,15 @@ jobs:
with:
name: bindings-x86_64-apple-darwin
path: artifacts
- name: List artifacts
run: ls /Users/runner/work/surrealdb.node/surrealdb.node/artifacts
- name: Download macOS arm64 artifact
uses: actions/download-artifact@v3
with:
name: bindings-aarch64-apple-darwin
path: artifacts
- name: List artifacts
run: ls /Users/runner/work/surrealdb.node/surrealdb.node/artifacts
- name: Combine binaries
run: yarn universal
- name: Upload artifact
Expand All @@ -459,17 +471,52 @@ jobs:
name: bindings-universal-apple-darwin
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
publish-dry-run:
name: Publish dry run
runs-on: ubuntu-latest
needs:
# - build-freebsd
- test-macOS-windows-binding
- test-linux-x64-gnu-binding
- test-linux-x64-musl-binding
# - test-linux-aarch64-gnu-binding
# - test-linux-aarch64-musl-binding
# - test-linux-arm-gnueabihf-binding
- universal-macOS
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
check-latest: true
cache: yarn
- name: Install dependencies
run: yarn install
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Move artifacts
run: yarn artifacts
- name: Fix npm dirs
run: yarn napi create-npm-dir -t .
- name: List packages
run: ls -R ./npm
shell: bash
- name: Compile TypeScript
run: yarn ts-compile
publish:
if: ${{github.event_name == 'release'}}
name: Publish
runs-on: ubuntu-latest
needs:
- build-freebsd
# - build-freebsd
- test-macOS-windows-binding
- test-linux-x64-gnu-binding
- test-linux-x64-musl-binding
- test-linux-aarch64-gnu-binding
- test-linux-aarch64-musl-binding
# - test-linux-aarch64-gnu-binding
# - test-linux-aarch64-musl-binding
# - test-linux-arm-gnueabihf-binding
- universal-macOS
steps:
Expand All @@ -493,6 +540,8 @@ jobs:
- name: List packages
run: ls -R ./npm
shell: bash
- name: Compile TypeScript
run: yarn ts-compile
- name: Publish
run: |
npm config set provenance true
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,7 @@ $RECYCLE.BIN/

*.node

examples
examples
.idea
lib/*
test.skv
Loading
Loading