|
1 | | -name: Run Z-Wave Stack (Windows + WSL) |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: [ main ] |
6 | | - pull_request: |
7 | | - branches: [ main ] |
8 | | - workflow_dispatch: |
9 | | - |
10 | | -jobs: |
11 | | - run-zwave-wsl: |
12 | | - runs-on: windows-latest |
13 | | - |
14 | | - steps: |
15 | | - - name: Checkout repository |
16 | | - uses: actions/checkout@v4 |
17 | | - |
18 | | - - name: Setup WSL with Ubuntu |
19 | | - uses: Vampire/setup-wsl@v6 |
20 | | - with: |
21 | | - distribution: Ubuntu-24.04 |
22 | | - update: true |
23 | | - |
24 | | - - name: Enable 32-bit architecture and install libraries |
25 | | - shell: wsl-bash {0} |
26 | | - run: | |
27 | | - sudo dpkg --add-architecture i386 |
28 | | - sudo apt-get update |
29 | | - sudo apt-get install -y libc6:i386 libstdc++6:i386 |
30 | | -
|
31 | | - - name: Make Z-Wave binaries executable |
32 | | - shell: wsl-bash {0} |
33 | | - run: chmod +x zwave_stack/*.elf |
34 | | - |
35 | | - - name: Start Z-Wave stack and verify output |
36 | | - shell: wsl-bash {0} |
37 | | - run: | |
38 | | - # Start the Z-Wave stack and capture output |
39 | | - ./start-zwave-stack.sh > /tmp/zwave-output.log 2>&1 & |
40 | | -
|
41 | | - # Wait for services to start |
42 | | - sleep 5 |
43 | | -
|
44 | | - # Show the output |
45 | | - cat /tmp/zwave-output.log |
46 | | -
|
47 | | - # Verify expected output |
48 | | - if grep -q "All Z-Wave binaries started!" /tmp/zwave-output.log; then |
49 | | - echo "✓ Z-Wave stack started successfully" |
50 | | - else |
51 | | - echo "✗ Failed to find expected output" |
52 | | - exit 1 |
53 | | - fi |
54 | | -
|
55 | | - - name: Test TCP connection from Windows |
56 | | - shell: powershell |
57 | | - run: | |
58 | | - Write-Host "Testing TCP connectivity to WSL Z-Wave stack on port 5000..." |
59 | | - $connection = Test-NetConnection -ComputerName localhost -Port 5000 -WarningAction SilentlyContinue |
60 | | - if ($connection.TcpTestSucceeded) { |
61 | | - Write-Host "✓ Port 5000 is accessible from Windows" |
62 | | - } else { |
63 | | - Write-Host "✗ Port 5000 is NOT accessible from Windows" |
64 | | - exit 1 |
65 | | - } |
| 1 | +name: Run Z-Wave Stack (Windows + WSL) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + run-zwave-wsl: |
| 12 | + runs-on: windows-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Setup WSL with Debian |
| 19 | + uses: Vampire/setup-wsl@v6 |
| 20 | + with: |
| 21 | + distribution: Debian |
| 22 | + update: true |
| 23 | + |
| 24 | + - name: Enable 32-bit architecture and install libraries |
| 25 | + shell: wsl-bash {0} |
| 26 | + run: | |
| 27 | + sudo dpkg --add-architecture i386 |
| 28 | + sudo apt-get update |
| 29 | + sudo apt-get install -y libc6:i386 libstdc++6:i386 |
| 30 | +
|
| 31 | + - name: Make Z-Wave binaries executable |
| 32 | + shell: wsl-bash {0} |
| 33 | + run: chmod +x zwave_stack/*.elf |
| 34 | + |
| 35 | + - name: Start Z-Wave stack and verify output |
| 36 | + shell: wsl-bash {0} |
| 37 | + run: | |
| 38 | + # Start the Z-Wave stack and capture output |
| 39 | + # Use 'bash' explicitly to avoid CRLF line ending issues with shebang |
| 40 | + bash ./start-zwave-stack.sh > /tmp/zwave-output.log 2>&1 & |
| 41 | +
|
| 42 | + # Wait for services to start |
| 43 | + sleep 5 |
| 44 | +
|
| 45 | + # Show the output |
| 46 | + cat /tmp/zwave-output.log |
| 47 | +
|
| 48 | + # Verify expected output |
| 49 | + if grep -q "All Z-Wave binaries started!" /tmp/zwave-output.log; then |
| 50 | + echo "✓ Z-Wave stack started successfully" |
| 51 | + else |
| 52 | + echo "✗ Failed to find expected output" |
| 53 | + exit 1 |
| 54 | + fi |
| 55 | +
|
| 56 | + - name: Test TCP connection from Windows |
| 57 | + shell: powershell |
| 58 | + run: | |
| 59 | + Write-Host "Testing TCP connectivity to WSL Z-Wave stack on port 5000..." |
| 60 | + $connection = Test-NetConnection -ComputerName localhost -Port 5000 -WarningAction SilentlyContinue |
| 61 | + if ($connection.TcpTestSucceeded) { |
| 62 | + Write-Host "✓ Port 5000 is accessible from Windows" |
| 63 | + } else { |
| 64 | + Write-Host "✗ Port 5000 is NOT accessible from Windows" |
| 65 | + exit 1 |
| 66 | + } |
0 commit comments