mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-04 10:52:56 +00:00
aws integration tests are flaky because we didn't wait for the services to become healthy. (we only waited for the localstack service, this PR adds wait for sub services)
164 lines
4.3 KiB
YAML
164 lines
4.3 KiB
YAML
name: Node
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
paths:
|
|
- node/**
|
|
- rust/ffi/node/**
|
|
- .github/workflows/node.yml
|
|
- docker-compose.yml
|
|
|
|
env:
|
|
# Disable full debug symbol generation to speed up CI build and keep memory down
|
|
# "1" means line tables only, which is useful for panic tracebacks.
|
|
RUSTFLAGS: "-C debuginfo=1"
|
|
RUST_BACKTRACE: "1"
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-22.04
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: node
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
cache: 'npm'
|
|
cache-dependency-path: node/package-lock.json
|
|
- name: Lint
|
|
run: |
|
|
npm ci
|
|
npm run lint
|
|
linux:
|
|
name: Linux (Node ${{ matrix.node-version }})
|
|
timeout-minutes: 30
|
|
strategy:
|
|
matrix:
|
|
node-version: [ "16", "18" ]
|
|
runs-on: "ubuntu-22.04"
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: node
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'npm'
|
|
cache-dependency-path: node/package-lock.json
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y protobuf-compiler libssl-dev
|
|
- name: Build
|
|
run: |
|
|
npm ci
|
|
npm run tsc
|
|
npm run build
|
|
npm run pack-build
|
|
npm install --no-save ./dist/lancedb-vectordb-*.tgz
|
|
# Remove index.node to test with dependency installed
|
|
rm index.node
|
|
- name: Test
|
|
run: npm run test
|
|
macos:
|
|
timeout-minutes: 30
|
|
runs-on: "macos-13"
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: node
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
cache: 'npm'
|
|
cache-dependency-path: node/package-lock.json
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Install dependencies
|
|
run: brew install protobuf
|
|
- name: Build
|
|
run: |
|
|
npm ci
|
|
npm run tsc
|
|
npm run build
|
|
npm run pack-build
|
|
npm install --no-save ./dist/lancedb-vectordb-*.tgz
|
|
# Remove index.node to test with dependency installed
|
|
rm index.node
|
|
- name: Test
|
|
run: |
|
|
npm run test
|
|
aws-integtest:
|
|
timeout-minutes: 45
|
|
runs-on: "ubuntu-22.04"
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: node
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ACCESSKEY
|
|
AWS_SECRET_ACCESS_KEY: SECRETKEY
|
|
AWS_DEFAULT_REGION: us-west-2
|
|
# this one is for s3
|
|
AWS_ENDPOINT: http://localhost:4566
|
|
# this one is for dynamodb
|
|
DYNAMODB_ENDPOINT: http://localhost:4566
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
cache: 'npm'
|
|
cache-dependency-path: node/package-lock.json
|
|
- name: start local stack
|
|
run: docker compose -f ../docker-compose.yml up -d --wait
|
|
- name: create s3
|
|
run: aws s3 mb s3://lancedb-integtest --endpoint $AWS_ENDPOINT
|
|
- name: create ddb
|
|
run: |
|
|
aws dynamodb create-table \
|
|
--table-name lancedb-integtest \
|
|
--attribute-definitions '[{"AttributeName": "base_uri", "AttributeType": "S"}, {"AttributeName": "version", "AttributeType": "N"}]' \
|
|
--key-schema '[{"AttributeName": "base_uri", "KeyType": "HASH"}, {"AttributeName": "version", "KeyType": "RANGE"}]' \
|
|
--provisioned-throughput '{"ReadCapacityUnits": 10, "WriteCapacityUnits": 10}' \
|
|
--endpoint-url $DYNAMODB_ENDPOINT
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y protobuf-compiler libssl-dev
|
|
- name: Build
|
|
run: |
|
|
npm ci
|
|
npm run tsc
|
|
npm run build
|
|
npm run pack-build
|
|
npm install --no-save ./dist/lancedb-vectordb-*.tgz
|
|
# Remove index.node to test with dependency installed
|
|
rm index.node
|
|
- name: Test
|
|
run: npm run integration-test
|