Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ jobs:
./gradlew publish -i

build-nodejs:
if: ${{ always() && (github.event_name == 'schedule' || github.event.inputs.skipNodejs != 'true') && needs.build-precompiled-bin.result == 'success' && needs.build-linux-builder-image.result == 'success' && (needs.build-extension.result == 'success' || github.event.inputs.skipExtensions == 'true') }}
needs: [build-precompiled-bin, build-linux-builder-image, build-extension]
if: ${{ always() && (github.event_name == 'schedule' || github.event.inputs.skipNodejs != 'true') && needs.build-precompiled-bin.result == 'success' && needs.build-linux-builder-image.result == 'success' }}
needs: [build-precompiled-bin, build-linux-builder-image]
strategy:
fail-fast: false
matrix:
Expand All @@ -359,7 +359,6 @@ jobs:
nodeVersion: ${{ matrix.node-version }}
artifactSuffix: ${{ matrix.artifact-suffix }}
linuxBuilderImage: ${{ needs.build-linux-builder-image.outputs.image }}
useBuiltExtensions: ${{ needs.build-extension.result == 'success' }}
secrets: inherit

deploy-nodejs:
Expand Down
76 changes: 0 additions & 76 deletions .github/workflows/nodejs-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ on:
required: false
default: "ghcr.io/ladybugdb/ubuntu-22.04-gcc13:latest"
type: string
useBuiltExtensions:
description: "Use the lbug-extensions artifact from this workflow run for Node.js tests"
required: false
default: false
type: boolean
workflow_call:
inputs:
isNightly:
Expand All @@ -43,10 +38,6 @@ on:
type: string
required: false
default: "ghcr.io/ladybugdb/ubuntu-22.04-gcc13:latest"
useBuiltExtensions:
type: boolean
required: false
default: false

jobs:
build-nodejs:
Expand Down Expand Up @@ -251,73 +242,6 @@ jobs:
make GEN=Ninja nodejs
ccache -s

- name: Download built extensions for tests
if: ${{ inputs.useBuiltExtensions == true }}
uses: actions/download-artifact@v4
with:
name: lbug-extensions
path: nodejs-extension-repo

- name: Start built extension repository for tests (non-Windows)
if: ${{ inputs.useBuiltExtensions == true && matrix.platform != 'win32' }}
shell: bash
run: |
set -euo pipefail
mkdir -p nodejs-extension-server
cp -R nodejs-extension-repo/releases/. nodejs-extension-server/
if [ -d nodejs-extension-repo/dataset ]; then
cp -R nodejs-extension-repo/dataset nodejs-extension-server/dataset
fi
extension_server="$PWD/nodejs-extension-server"
python3 -m http.server 8000 --bind 127.0.0.1 --directory "$extension_server" > nodejs-extension-server.log 2>&1 &
case "${{ matrix.platform }}-${{ matrix.arch }}" in
darwin-x64) platform_dir="osx_amd64" ;;
darwin-arm64) platform_dir="osx_arm64" ;;
linux-x64) platform_dir="linux_amd64" ;;
linux-arm64) platform_dir="linux_arm64" ;;
*) echo "Unsupported extension test platform: ${{ matrix.platform }}-${{ matrix.arch }}" && exit 1 ;;
esac
extension_version="$(grep 'DLBUG_EXTENSION_VERSION' CMakeLists.txt | cut -d '"' -f 2)"
extension_url="http://127.0.0.1:8000/v${extension_version}/${platform_dir}/json/libjson.lbug_extension"
for _ in {1..10}; do
if curl --fail --silent --show-error --noproxy '*' "$extension_url" >/dev/null; then
exit 0
fi
sleep 1
done
cat nodejs-extension-server.log
exit 1

- name: Start built extension repository for tests (Windows)
if: ${{ inputs.useBuiltExtensions == true && matrix.platform == 'win32' }}
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path nodejs-extension-server
Copy-Item -Recurse nodejs-extension-repo\releases\* nodejs-extension-server\
if (Test-Path nodejs-extension-repo\dataset) {
Copy-Item -Recurse nodejs-extension-repo\dataset nodejs-extension-server\dataset
}
$extensionServer = Join-Path $PWD "nodejs-extension-server"
Start-Process -FilePath python -ArgumentList "-m", "http.server", "8000", "--bind", "127.0.0.1", "--directory", $extensionServer -WindowStyle Hidden
$platform = "win_amd64"
$extensionVersion = (Select-String -Path CMakeLists.txt -Pattern 'DLBUG_EXTENSION_VERSION="([^"]+)"').Matches[0].Groups[1].Value
$url = "http://127.0.0.1:8000/v$extensionVersion/$platform/json/libjson.lbug_extension"
for ($i = 0; $i -lt 10; $i++) {
try {
Invoke-WebRequest -UseBasicParsing -Uri $url -TimeoutSec 2 | Out-Null
exit 0
} catch {
Start-Sleep -Seconds 1
}
}
Invoke-WebRequest -UseBasicParsing -Uri $url -TimeoutSec 2

- name: Use built extension repository in Node.js tests
if: ${{ inputs.useBuiltExtensions == true }}
shell: bash
run: |
sed -i.bak "s|INSTALL JSON|INSTALL JSON FROM 'http://127.0.0.1:8000/'|" tools/nodejs_api/test/test_data_type.js

- name: Run Node.js tests
working-directory: tools/nodejs_api
run: npm test
Expand Down
Loading