-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (118 loc) · 3.81 KB
/
run-zwave-wsl.yml
File metadata and controls
139 lines (118 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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
## Set up operating system
- 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
## Set up repo scripts etc.
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Install dependencies
run: npm ci
- name: Install Z-Wave JS dependencies
run: npm ci
working-directory: dut/zwave-js
## Set up CTT
- name: Extract CTT setup files
shell: powershell
run: .\setup\unpack-ctt-archive.ps1
## Set up Z-Wave stack
- name: Download Z-Wave stack binaries
shell: powershell
env:
GH_TOKEN: ${{ secrets.ZW_STACK_TOKEN }}
run: .\setup\download-zwave-stack.ps1
- name: Make Z-Wave binaries executable
shell: wsl-bash {0}
run: chmod +x zwave_stack/bin/*.elf
## Restore network state for CTT project
- name: Extract network state
shell: powershell
run: .\setup\unpack-network-state-archive.ps1
- name: Copy Z-Wave stack to WSL native filesystem
shell: wsl-bash {0}
run: |
# Copy entire zwave_stack to native WSL filesystem for better performance
rm -rf ~/zwave_stack
cp -r ./zwave_stack ~/zwave_stack
chmod +x ~/zwave_stack/bin/*.elf
echo "Z-Wave stack copied to native WSL filesystem:"
ls -la ~/zwave_stack/
ls -la ~/zwave_stack/bin/
ls -la ~/zwave_stack/storage/
## Do the testing stuff
- name: Run CTT tests
shell: powershell
run: |
npm start -- `
--group=Automatic `
--group=Interactive `
--exclude=CCT_CRC16EncapsulationCmdClassV1_Rev02 `
--exclude=PI_CertificationData_Rev01 `
--exclude=DD_ManufacturerSpecificCCData_Rev01 `
--exclude=DD_VersionCCData_Rev01
env:
CI: true
- name: Package CTT test logs
if: always()
shell: powershell
run: |
$logPath = "ctt/project/Log"
$outputPath = "ctt-test-logs"
if (Test-Path $logPath) {
New-Item -ItemType Directory -Force -Path $outputPath | Out-Null
Get-ChildItem -Path $logPath -Directory | ForEach-Object {
$testResultFile = Join-Path $_.FullName "TestResult.xml"
if (Test-Path $testResultFile) {
[xml]$xml = Get-Content $testResultFile
$suiteName = $xml.testsuites.testsuite.name
if ($suiteName) {
$zipName = "$suiteName.zip"
$zipPath = Join-Path $outputPath $zipName
Compress-Archive -Path $_.FullName -DestinationPath $zipPath -Force
Write-Host "Created: $zipName"
}
}
}
}
- name: Upload CTT test logs
uses: actions/upload-artifact@v4
if: always()
with:
name: ctt-test-logs
path: ctt-test-logs/
if-no-files-found: ignore
- name: Upload CTT project file
uses: actions/upload-artifact@v4
if: always()
with:
name: "Root Device.cttproj"
path: ctt/project/Root Device/Root Device.cttproj
if-no-files-found: ignore
- name: Upload Z-Wave JS logs
uses: actions/upload-artifact@v4
if: always()
with:
name: zwave-js-logs
path: dut/zwave-js/log/
if-no-files-found: ignore