Skip to content

Commit 037f227

Browse files
committed
check in latest state
1 parent 95aa13e commit 037f227

9 files changed

Lines changed: 2762 additions & 224 deletions

File tree

.github/workflows/run-ctt-remote-linux.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 70 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,70 @@
1-
name: Run CTT-Remote
2-
3-
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
8-
workflow_dispatch:
9-
10-
jobs:
11-
run-ctt-remote:
12-
runs-on: windows-latest
13-
14-
steps:
15-
- name: Checkout repository
16-
uses: actions/checkout@v4
17-
18-
- name: Setup Node.js 24
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: '24'
22-
cache: 'npm'
23-
24-
- name: Setup .NET Framework 4.8
25-
shell: powershell
26-
run: |
27-
# Check if .NET Framework 4.8 is already installed
28-
$dotNetVersion = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' | Get-ItemPropertyValue -Name Release -ErrorAction SilentlyContinue
29-
30-
if ($dotNetVersion -ge 528040) {
31-
Write-Host ".NET Framework 4.8 or later is already installed"
32-
} else {
33-
Write-Host "Installing .NET Framework 4.8..."
34-
# Download .NET Framework 4.8 installer
35-
$installerUrl = "https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe"
36-
$installerPath = "$env:TEMP\ndp48-installer.exe"
37-
38-
Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath
39-
40-
# Install silently
41-
Start-Process -FilePath $installerPath -ArgumentList "/q", "/norestart" -Wait -NoNewWindow
42-
43-
Write-Host ".NET Framework 4.8 installation completed"
44-
}
45-
46-
- name: Verify .NET Framework installation
47-
shell: powershell
48-
run: |
49-
$dotNetVersion = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' | Get-ItemPropertyValue -Name Release -ErrorAction SilentlyContinue
50-
Write-Host ".NET Framework version: $dotNetVersion"
51-
52-
if ($dotNetVersion -ge 528040) {
53-
Write-Host ".NET Framework 4.8 or later is installed"
54-
} else {
55-
Write-Error ".NET Framework 4.8 is not installed"
56-
exit 1
57-
}
58-
59-
- name: Enable Docker Linux containers
60-
shell: powershell
61-
run: |
62-
Write-Host "Switching Docker to Linux containers..."
63-
& "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchLinuxEngine
64-
65-
# Poll Docker until it's ready with Linux containers (max 30 seconds)
66-
$maxAttempts = 30
67-
$attempt = 0
68-
$ready = $false
69-
70-
while ($attempt -lt $maxAttempts) {
71-
$attempt++
72-
Write-Host "Checking Docker status (attempt $attempt/$maxAttempts)..."
73-
74-
try {
75-
$dockerInfo = docker info 2>&1 | Out-String
76-
if ($dockerInfo -match "OSType: linux") {
77-
Write-Host "Docker is configured for Linux containers"
78-
$ready = $true
79-
break
80-
}
81-
} catch {
82-
Write-Host "Docker not ready yet..."
83-
}
84-
85-
Start-Sleep -Seconds 1
86-
}
87-
88-
if (-not $ready) {
89-
Write-Error "Docker failed to switch to Linux containers within 30 seconds"
90-
exit 1
91-
}
92-
93-
- name: Build Docker image for Z-Wave stack
94-
run: docker compose build
95-
96-
- name: Install npm dependencies
97-
run: npm install
98-
99-
- name: Start all services (Docker + CTT-Remote + WebSocket server)
100-
run: npm start
101-
timeout-minutes: 60
102-
103-
- name: Stop Docker container
104-
if: always()
105-
run: docker compose down
1+
name: Run CTT-Remote (Linux)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
run-ctt-remote:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js 24
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '24'
22+
cache: 'npm'
23+
24+
- name: Enable 32-bit architecture
25+
run: |
26+
sudo dpkg --add-architecture i386
27+
sudo apt-get update
28+
29+
- name: Install 32-bit libraries for Z-Wave binaries
30+
run: |
31+
sudo apt-get install -y libc6:i386 libstdc++6:i386
32+
33+
- name: Install Wine
34+
run: |
35+
sudo apt-get install -y wine wine32
36+
37+
- name: Download and install Wine Mono
38+
run: |
39+
wget -q https://dl.winehq.org/wine/wine-mono/9.0.0/wine-mono-9.0.0-x86.msi -O /tmp/wine-mono.msi
40+
# Initialize Wine prefix first
41+
WINEDEBUG=-all wineboot --init
42+
# Install Wine Mono
43+
WINEDEBUG=-all wine msiexec /i /tmp/wine-mono.msi /qn
44+
45+
- name: Verify Wine setup
46+
run: |
47+
wine --version
48+
WINEDEBUG=-all wine cmd /c echo "Wine is working"
49+
50+
- name: Extract appdata.tgz
51+
run: tar -xzvf appdata.tgz
52+
53+
- name: Make Z-Wave binaries executable
54+
run: chmod +x zwave_stack/*.elf
55+
56+
- name: Test Z-Wave binary
57+
run: |
58+
./zwave_stack/ZW_zwave_ncp_serial_api_controller_25_9_0_x86_REALTIME_DEBUG.elf --help
59+
60+
- name: Test CTT-Remote with Wine
61+
run: |
62+
cd CTT-Remote
63+
WINEDEBUG=-all wine ./CTT-Remote.exe --help
64+
65+
- name: Install npm dependencies
66+
run: npm install
67+
68+
- name: Start all services (native Z-Wave + Wine CTT-Remote + WebSocket server)
69+
run: npm start
70+
timeout-minutes: 60

0 commit comments

Comments
 (0)