From e28f3452c22758eb2384aa90f5f5fd50cd216b8c Mon Sep 17 00:00:00 2001 From: Marco Thaller Date: Thu, 7 Nov 2024 21:39:27 +0100 Subject: [PATCH] WIP: add windows workflow with mosquitto installation --- .github/workflows/build_windows.yml | 90 +++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/build_windows.yml diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml new file mode 100644 index 0000000..f136ce9 --- /dev/null +++ b/.github/workflows/build_windows.yml @@ -0,0 +1,90 @@ +# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company +# +# SPDX-License-Identifier: MIT + +name: CI Windows + +on: [push, pull_request] + +jobs: + build: + runs-on: windows-2022 + # strategy: + # fail-fast: false + # matrix: + # os: + # - ubuntu-22.04 + # #- ubuntu-20.04 + # - + # #- windows-2019 + # #- macos-12 + # #- macos-11 + # build_type: + # - Debug + # - Release + env: + MOSQUITTO_VERSION: 2.0.20 + SLINT_VERSION: 1.8.0 + + steps: + # - name: Checkout sources + # uses: actions/checkout@v4 + + # - name: Install ninja-build tool + # uses: turtlesec-no/get-ninja@main + + # - name: Make sure MSVC is found when Ninja generator is in use + # uses: ilammy/msvc-dev-cmd@v1 + + - name: Download Mosquitto Installer + run: | + Invoke-WebRequest -Uri "https://mosquitto.org/files/binary/win64/mosquitto-$env:MOSQUITTO_VERSION-install-windows-x64.exe" -OutFile "mosquitto-installer.exe" + shell: pwsh + + - name: Install Mosquitto + run: | + Start-Process -FilePath .\mosquitto-installer.exe -ArgumentList '/S' -NoNewWindow -Wait + shell: pwsh + + - name: Add Mosquitto to PATH + shell: pwsh + run: | + $env:Path += ";C:\Program Files\mosquitto" + Write-Host "PATH updated for mosquitto." + + - name: Verify Mosquitto Installation + run: mosquitto -h + shell: cmd + + # - name: Download Slint (Windows) + # run: | + # curl --no-progress-meter --location --remote-name ` + # https://github.com/slint-ui/slint/releases/download/v$env:SLINT_VERSION/Slint-cpp-$env:SLINT_VERSION-win64.exe + # & .\Slint-cpp-$env:SLINT_VERSION-win64.exe /S /D=c:\slint + # Write-Output "SLINT_INSTALL_LOCATION=c:\slint" >> $env:GITHUB_ENV + + # Tests build only on Linux right now + # - name: Configure project + # run: > + # cmake -S . -B ./build -G Ninja + # -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + # -DBUILD_TESTS=${{ matrix.os == 'Linux' && matrix.build_type == 'Debug'}} + # -DCMAKE_PREFIX_PATH=${{ env.SLINT_INSTALL_LOCATION }} + + # - name: Build Project + # run: cmake --build ./build + +# Tests turned off due to linker errors on Windows +# - name: Run tests on Windows/macOS +# if: ${{ matrix.build_type == 'Debug' && runner.os != 'Linux' }} +# run: ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure + + # - name: Run tests on Linux + # if: ${{ matrix.build_type == 'Debug' && runner.os == 'Linux' }} + # run: ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure + + # - name: Read tests log when it fails + # uses: andstor/file-reader-action@v1 + # if: ${{ failure() && matrix.build_type == 'Debug' }} + # with: + # path: "./build/Testing/Temporary/LastTest.log"