Node22 support and ci #6
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: Electron CI - ARM64 | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| jobs: | |
| build-arm64: | |
| name: Build and Test with Electron 39.2.7 - Linux ARM64 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build and Test Electron on ARM64 | |
| uses: uraimo/run-on-arch-action@v2 | |
| with: | |
| arch: aarch64 | |
| distro: ubuntu22.04 | |
| # Install dependencies in the container | |
| install: | | |
| apt-get update -q -y | |
| apt-get install -q -y ca-certificates curl gnupg build-essential python3 git \ | |
| libgtk-3-dev libnotify-dev libnss3 libxss1 \ | |
| libx11-xcb1 libxcb-dri3-0 libdrm2 libgbm1 \ | |
| xvfb dbus-x11 | |
| # Try to install libasound2t64, fallback to libasound2 | |
| apt-get install -q -y libasound2t64 || apt-get install -q -y libasound2 | |
| # 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 | |
| # Run build and tests | |
| run: | | |
| echo "Running on ARM64 architecture" | |
| node --version | |
| npm --version | |
| echo "Installing dependencies..." | |
| npm install | |
| echo "Installing Electron rebuild tools..." | |
| npm install --save-dev @electron/rebuild [email protected] electron-mocha | |
| echo "Rebuilding for Electron..." | |
| npx @electron/rebuild --version 39.2.7 | |
| echo "Starting virtual display for Electron..." | |
| export DISPLAY=:99 | |
| Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
| sleep 2 | |
| echo "Running tests with Electron..." | |
| npx electron-mocha --no-sandbox 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 | |
| echo "Testing Electron module loading..." | |
| npx electron --no-sandbox --version | |
| npx electron --no-sandbox test/electron-load-test.js |