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: Run Z-Wave Stack (Windows + WSL) | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| run-zwave-wsl: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup WSL with Ubuntu | |
| uses: Vampire/setup-wsl@v6 | |
| with: | |
| distribution: Ubuntu-22.04 | |
| - name: Enable 32-bit architecture and install libraries | |
| shell: wsl-bash {0} | |
| run: | | |
| sudo dpkg --add-architecture i386 | |
| sudo apt-get update | |
| sudo apt-get install -y libc6:i386 libstdc++6:i386 | |
| - name: Make Z-Wave binaries executable | |
| shell: wsl-bash {0} | |
| run: chmod +x zwave_stack/*.elf | |
| - name: Start Z-Wave stack with nohup | |
| shell: wsl-bash {0} | |
| run: | | |
| # Start the Z-Wave stack with nohup so processes survive shell exit | |
| nohup bash ./start-zwave-stack.sh > /tmp/zwave-output.log 2>&1 & | |
| # Wait for services to start and bind ports | |
| sleep 5 | |
| # Show the output | |
| cat /tmp/zwave-output.log | |
| # Verify expected output | |
| if grep -q "All Z-Wave binaries started!" /tmp/zwave-output.log; then | |
| echo "[OK] Z-Wave stack started successfully" | |
| else | |
| echo "[FAIL] Failed to find expected output" | |
| exit 1 | |
| fi | |
| # Verify ports are listening in WSL | |
| echo "Checking ports in WSL..." | |
| ss -tlnp | grep -E "500[0-4]" || echo "Warning: ports not showing in ss" | |
| - name: Test TCP connection from Windows | |
| shell: powershell | |
| run: | | |
| Write-Host "Testing TCP connectivity to WSL Z-Wave stack on port 5000..." | |
| $connection = Test-NetConnection -ComputerName localhost -Port 5000 -WarningAction SilentlyContinue | |
| if ($connection.TcpTestSucceeded) { | |
| Write-Host "[OK] Port 5000 is accessible from Windows" | |
| } else { | |
| Write-Host "[FAIL] Port 5000 is NOT accessible from Windows" | |
| exit 1 | |
| } |