Node22 support and ci #18
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 | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| jobs: | |
| build: | |
| name: Build and Test with Electron ${{ matrix.electron-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: windows-latest | |
| electron-version: '39.2.7' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| - 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 | |
| - 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 | |
| - name: Install Electron rebuild tools | |
| run: npm install --save-dev @electron/rebuild electron@${{ matrix.electron-version }} | |
| - name: Rebuild for Electron | |
| run: npx @electron/rebuild --version ${{ matrix.electron-version }} | |
| - name: Show build output | |
| shell: bash | |
| run: | | |
| echo "Checking for native module..." | |
| if [ -f "build/Release/sqlanywhere.node" ]; then | |
| echo "✓ Native module found" | |
| ls -lh build/Release/sqlanywhere.node | |
| file build/Release/sqlanywhere.node || true | |
| else | |
| echo "✗ Native module NOT found" | |
| echo "Build directory contents:" | |
| ls -la build/ || echo "Build directory does not exist" | |
| fi | |
| - name: Run tests with Electron | |
| run: | | |
| npm test | |
| continue-on-error: true | |
| id: test | |
| - name: Show test results | |
| if: always() | |
| shell: bash | |
| run: | | |
| if [ "${{ steps.test.outcome }}" == "success" ]; then | |
| echo "✓ Tests passed" | |
| else | |
| echo "✗ Tests failed (may be expected if SQL Anywhere is not installed)" | |
| fi | |
| - name: Test module loading with Electron | |
| shell: bash | |
| run: | | |
| npx electron --no-sandbox --version | |
| npx electron --no-sandbox test/electron-load-test.js |