Skip to content
Merged
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
109 changes: 54 additions & 55 deletions .github/workflows/electron-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,71 @@ on:

jobs:
build-arm64:
name: Build and Test with Electron 39.2.7 - Linux ARM64
runs-on: ubuntu-latest
name: Build and Test with Electron ${{ matrix.electron-version }} on Node ${{ matrix.node-version }} - Linux ARM64
runs-on: ubuntu-24.04-arm

strategy:
fail-fast: false
matrix:
electron-version: ['39.2.7', '44.3.0']
# Each Electron version builds against its own Node line, so Node is
# paired with the Electron version rather than varied independently.
include:
- electron-version: '39.2.7'
node-version: '22'
- electron-version: '44.3.0'
node-version: '24'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build and Test Electron on ARM64
uses: uraimo/run-on-arch-action@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
arch: aarch64
distro: ubuntu22.04

# Docker options to improve QEMU compatibility
dockerRunArgs: |
--platform linux/arm64/v8

# Install dependencies in the container
install: |
apt-get update -q -y
apt-get install -q -y ca-certificates curl gnupg build-essential python3 git \
libglib2.0-0 libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 \
libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 \
libgtk-3-0 libasound2 libatspi2.0-0 libdbus-1-3
# Install Node.js 20 (for Electron build)
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt-get update -q -y
apt-get install -q -y nodejs
node --version
npm --version
node-version: ${{ matrix.node-version }}

# Run build and tests
run: |
echo "Running on ARM64 architecture"
node --version
npm --version
- name: Show tool versions
run: |
node --version
npm --version

# Set environment variables to help with QEMU/node-gyp compatibility
export npm_config_jobs=1
export JOBS=1
- name: Install system dependencies
run: |
sudo apt-get update
# Ubuntu 24.04 renamed several of these with a t64 suffix (the 64-bit
# time_t transition); fall back to the old names on older releases.
sudo apt-get install -y build-essential python3 \
libgtk-3-0t64 libnss3 libasound2t64 libatspi2.0-0t64 libcups2t64 \
libnotify4 libxss1 libgbm1 libdrm2 \
|| sudo apt-get install -y build-essential python3 \
libgtk-3-0 libnss3 libasound2 libatspi2.0-0 libcups2 \
libnotify4 libxss1 libgbm1 libdrm2

echo "Installing dependencies..."
npm install
- name: Install npm dependencies
run: npm install

echo "Installing Electron rebuild tools..."
npm install --save-dev @electron/rebuild electron@39.2.7
- name: Install Electron rebuild tools
run: npm install --save-dev @electron/rebuild electron@${{ matrix.electron-version }}

echo "Rebuilding for Electron..."
npx @electron/rebuild --version 39.2.7
- name: Rebuild for Electron
run: npx @electron/rebuild --version ${{ matrix.electron-version }}

echo "Running tests with Electron (as Node)..."
ELECTRON_RUN_AS_NODE=1 npx electron node_modules/.bin/mocha test/**/*.test.js --timeout 10000
- name: Run tests with Electron (as Node)
run: ELECTRON_RUN_AS_NODE=1 npx electron node_modules/.bin/mocha test/**/*.test.js --timeout 10000

echo "Verifying native module..."
if [ -f "build/Release/sqlanywhere.node" ]; then
echo "✓ Native module built successfully"
ls -lh build/Release/sqlanywhere.node
file build/Release/sqlanywhere.node || true
else
echo "✗ Native module NOT found"
exit 1
fi
- name: Verify native module
run: |
if [ -f "build/Release/sqlanywhere.node" ]; then
echo "✓ Native module built successfully"
ls -lh build/Release/sqlanywhere.node
file build/Release/sqlanywhere.node || true
else
echo "✗ Native module NOT found"
exit 1
fi

echo "Testing Electron module loading..."
ELECTRON_RUN_AS_NODE=1 npx electron --version
ELECTRON_RUN_AS_NODE=1 npx electron test/electron-load-test.js
- name: Test Electron module loading
run: |
ELECTRON_RUN_AS_NODE=1 npx electron --version
ELECTRON_RUN_AS_NODE=1 npx electron test/electron-load-test.js
60 changes: 38 additions & 22 deletions .github/workflows/electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,56 @@ on:

jobs:
build:
name: Build and Test with Electron ${{ matrix.electron-version }} - ${{ matrix.os }}
name: Build and Test with Electron ${{ matrix.electron-version }} on Node ${{ matrix.node-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
electron-version: ['39.2.7']
include:
# macOS ARM64 (Apple Silicon)
- os: macos-latest
electron-version: '39.2.7'
# macOS x64 (Intel)
- os: macos-14
electron-version: '39.2.7'
# Linux x64
- os: ubuntu-latest
electron-version: '39.2.7'
# Windows x64
os: [macos-latest, macos-14, ubuntu-latest, windows-latest]
electron-version: ['39.2.7', '44.3.0']
exclude:
# Electron 39 builds on Node 22, whose bundled node-gyp (11.5.0)
# cannot identify the Visual Studio 2026 on windows-latest.
- os: windows-latest
electron-version: '39.2.7'
include:
- electron-version: '39.2.7'
node-version: '22'
- electron-version: '44.3.0'
node-version: '24'
# ...so that combination builds against VS 2022 on the older image.
- os: windows-2022
electron-version: '39.2.7'
node-version: '22'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: ${{ matrix.node-version }}

- name: Show tool versions
shell: bash
run: |
node --version
npm --version

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 libgtk-3-dev libnotify-dev libnss3 libxss1 libasound2t64 || sudo apt-get install -y libasound2
sudo apt-get install -y xvfb build-essential python3 libgtk-3-dev libnotify-dev libnss3 libxss1 libasound2t64 || sudo apt-get install -y xvfb libasound2

- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
# Xcode Command Line Tools should be pre-installed
echo "macOS build tools ready"

- name: Setup MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Install npm dependencies
run: npm install

Expand All @@ -63,7 +67,14 @@ jobs:
run: npx @electron/rebuild --version ${{ matrix.electron-version }}

- name: Run tests with Electron
run: npx electron-mocha --no-sandbox test/**/*.test.js --timeout 10000
shell: bash
run: |
# Electron needs a display; the Linux runners are headless.
RUN=()
if [ "$RUNNER_OS" = "Linux" ]; then
RUN=(xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24")
fi
"${RUN[@]}" npx electron-mocha --no-sandbox test/**/*.test.js --timeout 10000

- name: Show build output
shell: bash
Expand All @@ -82,5 +93,10 @@ jobs:
- name: Test module loading with Electron
shell: bash
run: |
RUN=()
if [ "$RUNNER_OS" = "Linux" ]; then
RUN=(xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24")
fi
# --version prints without starting the GUI, so it needs no display.
npx electron --no-sandbox --version
npx electron --no-sandbox test/electron-load-test.js
"${RUN[@]}" npx electron --no-sandbox test/electron-load-test.js
86 changes: 37 additions & 49 deletions .github/workflows/nodejs-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,46 @@ on:

jobs:
build-arm64:
name: Build and Test on Node 22.x - Linux ARM64
runs-on: ubuntu-latest
name: Build and Test on Node ${{ matrix.node-version }} - Linux ARM64
runs-on: ubuntu-24.04-arm

strategy:
fail-fast: false
matrix:
node-version: ['22', '24']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build and Test on ARM64
uses: uraimo/run-on-arch-action@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
arch: aarch64
distro: ubuntu22.04

# Docker options to improve QEMU compatibility
dockerRunArgs: |
--platform linux/arm64/v8

# Install dependencies in the container
install: |
apt-get update -q -y
apt-get install -q -y ca-certificates curl gnupg build-essential python3 git
# Install Node.js 22
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt-get update -q -y
apt-get install -q -y nodejs
node --version
npm --version

# Run build and tests
run: |
echo "Running on ARM64 architecture"
node --version
npm --version

# Set environment variables to help with QEMU/node-gyp compatibility
export npm_config_jobs=1
export JOBS=1

echo "Installing dependencies..."
npm install

echo "Running tests..."
npm test

echo "Verifying native module..."
if [ -f "build/Release/sqlanywhere.node" ]; then
echo "✓ Native module built successfully"
ls -lh build/Release/sqlanywhere.node
file build/Release/sqlanywhere.node || true
else
echo "✗ Native module NOT found"
exit 1
fi
node-version: ${{ matrix.node-version }}

- name: Show tool versions
run: |
node --version
npm --version

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3

- name: Install npm dependencies
run: npm install

- name: Run tests
run: npm test

- name: Verify native module
run: |
if [ -f "build/Release/sqlanywhere.node" ]; then
echo "✓ Native module built successfully"
ls -lh build/Release/sqlanywhere.node
file build/Release/sqlanywhere.node || true
else
echo "✗ Native module NOT found"
exit 1
fi
35 changes: 19 additions & 16 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
# macOS ARM64 (Apple Silicon)
- os: macos-latest
node-version: 22.x
# macOS x64 (Intel)
- os: macos-14
node-version: 22.x
# Linux x64
- os: ubuntu-latest
node-version: 22.x
# Windows x64
# macos-latest = ARM64 (Apple Silicon), macos-14 = x64 (Intel),
# ubuntu-latest = Linux x64, windows-latest = Windows x64
os: [macos-latest, macos-14, ubuntu-latest, windows-latest]
node-version: ['22', '24']
exclude:
# windows-latest ships Visual Studio 2026, which the node-gyp
# bundled with Node 22's npm (11.5.0) cannot identify - VS 18
# support landed in node-gyp 12.2.0. Node 24's npm ships 12.4.0.
- os: windows-latest
node-version: 22.x
node-version: '22'
include:
# ...so Node 22 builds against VS 2022 on the older image instead.
- os: windows-2022
node-version: '22'

steps:
- name: Checkout code
Expand All @@ -36,6 +37,12 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Show tool versions
shell: bash
run: |
node --version
npm --version

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
Expand All @@ -47,10 +54,6 @@ jobs:
run: |
# Xcode Command Line Tools should be pre-installed

- name: Setup MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Install npm dependencies
run: npm install

Expand Down
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
node = "24"
Loading
Loading