Skip to content

Commit 911963c

Browse files
author
Aliaksandr Adziareika
committed
<TBBAS-2530> Add Windows dependencies
1 parent 97559b4 commit 911963c

File tree

4 files changed

+89
-6
lines changed

4 files changed

+89
-6
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Setup build tools on Windows
2+
3+
outputs:
4+
vcpkg-toolchain-file:
5+
value: ${{ steps.cvpkg-toolchain.outputs.filename }}
6+
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Install Chocolatey (if not installed)
12+
shell: pwsh
13+
run: |
14+
if (-not (Get-Command choco -ErrorAction SilentlyContinue)) {
15+
Set-ExecutionPolicy Bypass -Scope Process -Force
16+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
17+
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
18+
}
19+
20+
- name: Install CMake 4
21+
shell: pwsh
22+
run: |
23+
$cmakeVersion = (cmake --version | Select-String -Pattern "cmake version").ToString().Split()[2]
24+
Write-Host "Detected CMake version: $cmakeVersion"
25+
26+
if ([Version]$cmakeVersion -lt [Version]"4.0.3") {
27+
Write-Host "Installing CMake 4.0.3..."
28+
choco install cmake --version=4.0.3 --installargs '"ADD_CMAKE_TO_PATH=System"' -y
29+
} else {
30+
Write-Host "CMake $cmakeVersion is already >= 4.0.3. Skipping install."
31+
}
32+
33+
- name: Clone vcpkg
34+
shell: pwsh
35+
run: |
36+
$vcpkgRoot = "C:/vcpkg"
37+
38+
if (Test-Path "$vcpkgRoot/vcpkg.exe") {
39+
Write-Host "✅ vcpkg already installed at $vcpkgRoot"
40+
"$vcpkgRoot/bootstrap-vcpkg.bat"
41+
}
42+
else {
43+
if (Test-Path $vcpkgRoot) {
44+
Write-Host "⚠️ Found $vcpkgRoot but it's not a valid vcpkg, cleaning up..."
45+
Remove-Item -Recurse -Force $vcpkgRoot
46+
}
47+
git clone https://github.com/microsoft/vcpkg.git $vcpkgRoot
48+
& "$vcpkgRoot/bootstrap-vcpkg.bat"
49+
}
50+
51+
- name: Install fmt via vcpkg
52+
shell: pwsh
53+
run: |
54+
C:\vcpkg\vcpkg install date fmt tsl-ordered-map pkgconf xxhash
55+
56+
- name: Set CMake toolchain file for vcpkg
57+
id: cvpkg-toolchain
58+
shell: pwsh
59+
run: |
60+
echo "filename=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" > $env:GITHUB_OUTPUT

.github/actions/framework-download/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,10 @@ runs:
4848
$src = "${{ inputs.src-opendaq-framework-dev }}"
4949
Write-Host "Downloading $src to $dst"
5050
aws s3 cp "$src" "$dst"
51+
52+
- name: Upload Windows installer as artifact
53+
if: runner.os == 'Windows'
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: opendaq-installer
57+
path: ${{ inputs.dst-opendaq-framework-dev }}

.github/actions/framework-install/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ runs:
1717
shell: pwsh
1818
run: |
1919
$packagePath = Join-Path "${{ inputs.opendaq-framework-package-path }}" "${{ inputs.opendaq-framework-package-filename }}"
20-
& $packagePath /S
20+
Start-Process -FilePath $packagePath -ArgumentList "/S" -Wait -NoNewWindow
21+
echo "Laset exit code: $LASTEXITCODE"
22+
# & $packagePath /S
2123

2224
- name: Install openDAQ framework package (Linux)
2325
if: runner.os == 'Linux'

.github/workflows/ci.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,31 @@ jobs:
3939
with:
4040
opendaq-framework-package-filename: ${{ steps.opendaq-framework.outputs.artefact }}
4141

42-
- name: Setup cmake
42+
- name: Archive installed openDAQ
4343
if: runner.os == 'Windows'
44-
uses: jwlawson/actions-setup-cmake@v2
44+
shell: pwsh
45+
run: |
46+
Compress-Archive -Path "C:/Program Files/openDAQ" -DestinationPath "$env:RUNNER_TEMP/opendaq.zip"
47+
48+
- name: Upload openDAQ artifact
49+
if: runner.os == 'Windows'
50+
uses: actions/upload-artifact@v4
4551
with:
46-
cmake-version: '4.0'
52+
name: opendaq-install
53+
path: ${{ runner.temp }}/opendaq.zip
4754

48-
- name: Install ninja-build
55+
# - name: Install Windows dependencies
56+
# id: windows-dependencies-install
57+
# if: runner.os == 'Windows'
58+
# uses: ./.github/actions/dependencies-install
59+
60+
- name: Configure simple device module with CMake Windows
4961
if: runner.os == 'Windows'
50-
uses: seanmiddleditch/gha-setup-ninja@v5
62+
# run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ steps.windows-dependencies-install.outputs.vcpkg-toolchain-file }}
63+
run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
5164

5265
- name: Configure simple device module with CMake
66+
if: runner.os != 'Windows'
5367
run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
5468

5569
- name: Build simple device module with CMake

0 commit comments

Comments
 (0)