Skip to content

Commit 3255529

Browse files
author
Aliaksandr Adziareika
committed
Add test for Windows installation
1 parent e95f3fd commit 3255529

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

.github/workflows/test-install-sdk.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,43 @@ jobs:
157157
exit 1
158158
}
159159
160+
# Assert bin directory is in PATH
161+
$binPath = "C:\Program Files (x86)\openDAQ\bin"
162+
if ($env:PATH -notlike "*$binPath*") {
163+
Write-Host "::error::✗ PATH does not contain: $binPath"
164+
exit 1
165+
}
166+
167+
Write-Host "✓ Installation verification succeeded"
168+
169+
windows-autodetect:
170+
name: Windows Autodetect
171+
runs-on: windows-latest
172+
steps:
173+
- name: Checkout
174+
uses: actions/checkout@v4
175+
176+
- name: Install SDK (default version)
177+
id: install
178+
uses: ./install-sdk
179+
180+
- name: Verify Installation
181+
shell: pwsh
182+
env:
183+
INSTALLED_VERSION: ${{ steps.install.outputs.version }}
184+
run: |
185+
# Assert installation directory exists (64-bit)
186+
$installPath = "C:\Program Files\openDAQ"
187+
if (-not (Test-Path $installPath)) {
188+
Write-Host "::error::✗ Installation directory not found: $installPath"
189+
exit 1
190+
}
191+
192+
# Assert bin directory is in PATH
193+
$binPath = "C:\Program Files\openDAQ\bin"
194+
if ($env:PATH -notlike "*$binPath*") {
195+
Write-Host "::error::✗ PATH does not contain: $binPath"
196+
exit 1
197+
}
198+
160199
Write-Host "✓ Installation verification succeeded"

install-sdk/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
enable-32bit:
1010
description: 'Enable 32-bit version (only affects Windows, defaults to 64-bit)'
1111
required: false
12-
default: 'false'
12+
default: false
1313

1414
outputs:
1515
version:
@@ -184,6 +184,7 @@ runs:
184184
env:
185185
ASSET_FILENAME: ${{ steps.download.outputs.filename }}
186186
RUNNER_OS: ${{ runner.os }}
187+
OPENDAQ_SDK_ENABLE_32BIT: ${{ inputs.enable-32bit }}
187188
run: |
188189
if [ ! -f "$ASSET_FILENAME" ]; then
189190
echo "::error::✗ Downloaded asset not found: $ASSET_FILENAME"
@@ -219,6 +220,14 @@ runs:
219220
echo "::error::✗ Installation failed with exit code: $?"
220221
exit 1
221222
fi
223+
224+
# Add openDAQ to PATH
225+
if [ "$OPENDAQ_SDK_ENABLE_32BIT" = "true" ]; then
226+
OPENDAQ_BIN_PATH="C:\\Program Files (x86)\\openDAQ\\bin"
227+
else
228+
OPENDAQ_BIN_PATH="C:\\Program Files\\openDAQ\\bin"
229+
fi
230+
echo "$OPENDAQ_BIN_PATH" >> "$GITHUB_PATH"
222231
;;
223232
*)
224233
echo "::error::✗ Unsupported file type: $ASSET_FILENAME"

0 commit comments

Comments
 (0)