From d16f8ed9afa35ad8f5d94f118c0d44e054aff199 Mon Sep 17 00:00:00 2001 From: Aliaksandr Adziareika <8034372+alexadereyko@users.noreply.github.com> Date: Wed, 17 Sep 2025 12:21:22 +0200 Subject: [PATCH 1/7] Create reusable workflow and composite action for module build and test - Add ci-framework.yml: reusable workflow for testing with openDAQ framework artifacts - Add module-build-test composite action: automated CMake configure, build, and test - Update ci.yml: use new composite action, add fail-fast: false for matrix jobs --- .github/actions/framework-download/action.yml | 50 -------- .github/actions/framework-install/action.yml | 42 ------- .../framework-latest-release/action.yml | 111 ------------------ .github/actions/module-build-test/action.yml | 29 +++++ .github/workflows/ci-framework.yml | 82 +++++++++++++ .github/workflows/ci.yml | 85 ++++++-------- .gitignore | 7 +- 7 files changed, 152 insertions(+), 254 deletions(-) delete mode 100644 .github/actions/framework-download/action.yml delete mode 100644 .github/actions/framework-install/action.yml delete mode 100644 .github/actions/framework-latest-release/action.yml create mode 100644 .github/actions/module-build-test/action.yml create mode 100644 .github/workflows/ci-framework.yml diff --git a/.github/actions/framework-download/action.yml b/.github/actions/framework-download/action.yml deleted file mode 100644 index 6d34b86..0000000 --- a/.github/actions/framework-download/action.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Download openDAQ framework package -description: "Download a package from S3 for Linux or Windows" - -inputs: - src-opendaq-framework-dev: - required: true - description: "S3 path to the package" - dst-opendaq-framework-dev: - required: false - default: ${{ runner.temp }} - description: "Destination path for downloaded package" - - aws_access_key_id: - required: true - description: "AWS Access Key ID" - aws_secret_access_key: - required: true - description: "AWS Secret Access Key" - aws_region: - required: true - description: "AWS Region" - -runs: - using: composite - steps: - - name: Configure AWS - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ inputs.aws_access_key_id }} - aws-secret-access-key: ${{ inputs.aws_secret_access_key }} - aws-region: ${{ inputs.aws_region }} - - - name: Download package from S3 (Linux/macOS) - if: runner.os != 'Windows' - shell: bash - run: | - set -e - DST="${{ inputs.dst-opendaq-framework-dev }}" - SRC="${{ inputs.src-opendaq-framework-dev }}" - echo "Downloading $SRC to $DST" - aws s3 cp "$SRC" "$DST" - - - name: Download package from S3 (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - $dst = "${{ inputs.dst-opendaq-framework-dev }}" - $src = "${{ inputs.src-opendaq-framework-dev }}" - Write-Host "Downloading $src to $dst" - aws s3 cp "$src" "$dst" diff --git a/.github/actions/framework-install/action.yml b/.github/actions/framework-install/action.yml deleted file mode 100644 index 6e3e6de..0000000 --- a/.github/actions/framework-install/action.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Install openDAQ framework package - -inputs: - opendaq-framework-package-filename: - required: true - - opendaq-framework-package-path: - required: false - default: ${{ runner.temp }} - -runs: - using: composite - - steps: - - name: Install openDAQ framework package (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - $packagePath = Join-Path "${{ inputs.opendaq-framework-package-path }}" "${{ inputs.opendaq-framework-package-filename }}" - $process = Start-Process -FilePath $packagePath -ArgumentList "/S" -Wait -NoNewWindow -PassThru - if ($process.ExitCode -eq 0) { - Write-Host "OpenDAQ installed successfully, updating PATH..." - $openDAQBin = "C:\Program Files\openDAQ\bin" - Add-Content -Path $env:GITHUB_ENV -Value "PATH=$openDAQBin`;$env:PATH" - Write-Host $env:PATH - } - else { - Write-Host "OpenDAQ installation failed with exit code $($process.ExitCode)" - exit $process.ExitCode - } - - - name: Install openDAQ framework package (Linux) - if: runner.os == 'Linux' - shell: bash - run: sudo dpkg -i "${{ inputs.opendaq-framework-package-path }}/${{ inputs.opendaq-framework-package-filename }}" - - - name: Unsupported runner OS - if: runner.os != 'Windows' && runner.os != 'Linux' - shell: bash - run: | - echo "Install openDAQ is not supported for ${{ runner.os }}" - exit 1 diff --git a/.github/actions/framework-latest-release/action.yml b/.github/actions/framework-latest-release/action.yml deleted file mode 100644 index c2750b5..0000000 --- a/.github/actions/framework-latest-release/action.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: Determine latest openDAQ framework artefact - -inputs: - - opendaq-framework-release-version: - required: false - default: latest - - win32-force: - required: false - default: false - -outputs: - - version: - description: "Latest openDAQ release version" - value: ${{ steps.determine-latest-package.outputs.version }} - - platform: - description: "Detected platform" - value: ${{ steps.determine-latest-package.outputs.platform }} - - packaging: - description: "Package type (deb/exe)" - value: ${{ steps.determine-latest-package.outputs.packaging }} - - artefact: - description: "Artefact filename" - value: ${{ steps.determine-latest-package.outputs.artefact }} - - uri: - description: "Full URI to artefact" - value: ${{ steps.determine-latest-package.outputs.uri }} - - scheme: - description: "Scheme (s3)" - value: ${{ steps.determine-latest-package.outputs.scheme }} - - authority: - description: "Authority (bucket)" - value: ${{ steps.determine-latest-package.outputs.authority }} - - path: - description: "Path inside bucket" - value: ${{ steps.determine-latest-package.outputs.path }} - -runs: - using: composite - steps: - - name: Determine latest openDAQ package - id: determine-latest-package - shell: bash - run: | - set -e - - input_version="${{ inputs.opendaq-framework-release-version }}" - - if [[ -z "$input_version" || "$input_version" == "latest" ]]; then - version=$(gh api repos/openDAQ/openDAQ/releases/latest --jq '.tag_name') - if [[ -z "$version" || "$version" == "null" ]]; then - echo "::error::Failed to determine latest openDAQ release version" - exit 1 - fi - - version=${version#v} - else - version="$input_version" - fi - - platform="" - packaging="" - - if [[ "$RUNNER_OS" == "Linux" ]]; then - arch=$(uname -m) - if [[ "$arch" == "x86_64" ]]; then - platform="ubuntu22.04-x86_64" - elif [[ "$arch" == "aarch64" ]]; then - platform="ubuntu22.04-arm64" - else - echo "::error::Unsupported Linux arch: $arch" - exit 1 - fi - packaging="deb" - - elif [[ "$RUNNER_OS" == "Windows" ]]; then - WIN32_FORCE="${{ inputs.win32-force }}" - if [[ "$WIN32_FORCE" == "true" ]]; then - platform="win32" - else - platform="win64" - fi - packaging="exe" - - else - echo "::error::Unsupported runner OS $RUNNER_OS" - exit 1 - fi - - artefact="opendaq-${version}-${platform}.${packaging}" - scheme="s3" - authority="bb-blueberry-sdk-releases" - sdk="releases/v${version}/SDK" - - echo "version=$version" >> $GITHUB_OUTPUT - echo "platform=$platform" >> $GITHUB_OUTPUT - echo "packaging=$packaging" >> $GITHUB_OUTPUT - echo "artefact=$artefact" >> $GITHUB_OUTPUT - echo "scheme=$scheme" >> $GITHUB_OUTPUT - echo "authority=$authority" >> $GITHUB_OUTPUT - echo "path=$sdk" >> $GITHUB_OUTPUT - echo "uri=${scheme}://${authority}/${sdk}/${artefact}" >> $GITHUB_OUTPUT diff --git a/.github/actions/module-build-test/action.yml b/.github/actions/module-build-test/action.yml new file mode 100644 index 0000000..f5e0fb4 --- /dev/null +++ b/.github/actions/module-build-test/action.yml @@ -0,0 +1,29 @@ +name: Build and test simple device module +description: Configure, build and test simple device module with CMake + +runs: + using: composite + steps: + - name: Set CMake generator + shell: bash + run: | + if [[ "${{ runner.os }}" == "Windows" ]]; then + echo "CMAKE_GENERATOR=Visual Studio 17 2022" >> $GITHUB_ENV + else + echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV + fi + + - name: Configure simple device module with CMake + shell: bash + run: | + cmake -B build/output -S . -G "$CMAKE_GENERATOR" -DEXAMPLE_MODULE_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release + + - name: Build simple device module with CMake + shell: bash + run: | + cmake --build build/output --config Release + + - name: Run simple device module tests with CMake + shell: bash + run: | + ctest --test-dir build/output --output-on-failure -C Release -V diff --git a/.github/workflows/ci-framework.yml b/.github/workflows/ci-framework.yml new file mode 100644 index 0000000..e63c830 --- /dev/null +++ b/.github/workflows/ci-framework.yml @@ -0,0 +1,82 @@ +name: Build simple device module with openDAQ framework and run tests + +on: + workflow_dispatch: + inputs: + runner: + description: "Runner label" + required: true + type: string + + branch: + description: "Branch to checkout" + required: false + type: string + default: "" + + artifact-run-id: + required: true + type: string + + artifact-name: + required: true + type: string + + file-name: + required: true + type: string + + workflow_call: + inputs: + runner: + description: "Runner label" + required: true + type: string + + branch: + description: "Branch to checkout" + required: false + type: string + default: "" + + artifact-run-id: + required: true + type: string + + artifact-name: + required: true + type: string + + file-name: + required: true + type: string + +env: + GH_TOKEN: ${{ github.token }} + +jobs: + test-artifact: + runs-on: ${{ inputs.runner }} + + steps: + - name: Checkout openDAQ module repository + uses: actions/checkout@v4 + with: + repository: openDAQ/SimpleDeviceModule + ref: ${{ inputs.branch }} + + - name: Download openDAQ framework artifact + id: download + uses: openDAQ/actions/framework-download-artifact@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests + with: + run-id: ${{ inputs.artifact-run-id }} + artifact-name: ${{ inputs.artifact-name }} + artifact-filename: ${{ inputs.file-name }} + + - name: Install openDAQ framework artifact + uses: openDAQ/actions/framework-install@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests + with: + framework-filename: ${{ steps.download.outputs.artifact }} + + - name: Build and test simple device module + uses: ./.github/actions/module-build-test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0dce16..72bb675 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,74 +2,59 @@ name: Build and Test simple device module with latest openDAQ release on: push: - branches: - - main - + branches: [main] pull_request: - branches: - - main - - jira/* - - workflow_dispatch: - inputs: - - branch: - required: false - default: "main" - - opendaq-framework-version: - required: false - type: string - default: latest env: GH_TOKEN: ${{ github.token }} jobs: - build-and-test: + test-asset: + permissions: + contents: read + actions: read + + env: + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} strategy: + fail-fast: false matrix: include: - os: ubuntu-latest - generator: Ninja - + platform-alias: "ubuntu20.04-x86_64" - os: windows-latest - generator: "Visual Studio 17 2022" + platform-alias: "win64" runs-on: ${{ matrix.os }} - + steps: - name: Checkout simple device module repo uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }} - - name: Determine openDAQ framework package - id: opendaq-framework - uses: ./.github/actions/framework-latest-release + - name: Download openDAQ framework asset + id: download-framework-filename + uses: openDAQ/actions/framework-download-release@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests with: - opendaq-framework-release-version: ${{ github.event.inputs.opendaq-framework-version || 'latest' }} - - - name: Download openDAQ framework - uses: ./.github/actions/framework-download + platform: ${{ matrix.platform-alias }} + github-token: ${{ secrets.PAT_TOKEN }} + + - name: Normalize downloaded asset path + id: normalize-framework-filename + shell: bash + run: | + asset=${{ steps.download-framework-filename.outputs.asset }} + # Normalize output-dir path for cross-platform compatibility + if command -v cygpath >/dev/null 2>&1; then + asset="$(cygpath -w "$asset")" + echo "Normalized path (Windows): $asset" + fi + echo "asset=$asset" >> $GITHUB_OUTPUT + + - name: Install openDAQ framework asset + uses: openDAQ/actions/framework-install@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests with: - src-opendaq-framework-dev: ${{ steps.opendaq-framework.outputs.uri }} - dst-opendaq-framework-dev: ${{ runner.temp }}/${{ steps.opendaq-framework.outputs.artefact }} - aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws_region: ${{ secrets.AWS_REGION }} - - - name: Install openDAQ framework package - uses: ./.github/actions/framework-install - with: - opendaq-framework-package-filename: ${{ steps.opendaq-framework.outputs.artefact }} - - - name: Configure simple device module with CMake - run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DEXAMPLE_MODULE_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release - - - name: Build simple device module with CMake - run: cmake --build build/output --config Release + framework-filename: ${{ steps.normalize-framework-filename.outputs.asset }} - - name: Run simple device module tests with CMake - run: ctest --test-dir build/output --output-on-failure -C Release -V + - name: Build and test simple device module + uses: ./.github/actions/module-build-test diff --git a/.gitignore b/.gitignore index 295355a..72017e9 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,9 @@ bckp # cmake CMakeUserPresets.json -CMakeSettings.json \ No newline at end of file +CMakeSettings.json + +# Secrets +.secrets +# Local configs +.actrc From f6a1f7e95f1be43209c7586ea67962ab140e41ea Mon Sep 17 00:00:00 2001 From: Aliaksandr Adziareika <8034372+alexadereyko@users.noreply.github.com> Date: Thu, 6 Nov 2025 14:20:30 +0100 Subject: [PATCH 2/7] Replace openDAQ/actions/framewaork-download-artefact with actions/download-artifact@v5 --- .github/workflows/ci-framework.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-framework.yml b/.github/workflows/ci-framework.yml index e63c830..45f2df7 100644 --- a/.github/workflows/ci-framework.yml +++ b/.github/workflows/ci-framework.yml @@ -67,16 +67,18 @@ jobs: - name: Download openDAQ framework artifact id: download - uses: openDAQ/actions/framework-download-artifact@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests + uses: actions/download-artifact@v5 with: + repository: openDAQ/openDAQ + github-token: ${{ github.token }} run-id: ${{ inputs.artifact-run-id }} - artifact-name: ${{ inputs.artifact-name }} - artifact-filename: ${{ inputs.file-name }} + name: ${{ inputs.artifact-name }} + path: ${{ runner.temp }}/artifacts - name: Install openDAQ framework artifact uses: openDAQ/actions/framework-install@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests with: - framework-filename: ${{ steps.download.outputs.artifact }} + framework-filename: ${{ steps.download.outputs.download-path }}/${{ inputs.file-name }} - name: Build and test simple device module uses: ./.github/actions/module-build-test From c467872f773945b17716bd190256d27b574301bd Mon Sep 17 00:00:00 2001 From: Aliaksandr Adziareika <8034372+alexadereyko@users.noreply.github.com> Date: Mon, 10 Nov 2025 18:14:10 +0100 Subject: [PATCH 3/7] Replace framework-download-release with robinraju/release-downloader@v1 --- .github/workflows/ci.yml | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72bb675..16662fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: include: - os: ubuntu-latest - platform-alias: "ubuntu20.04-x86_64" + platform-alias: "ubuntu22.04-x86_64" - os: windows-latest platform-alias: "win64" @@ -32,29 +32,24 @@ jobs: - name: Checkout simple device module repo uses: actions/checkout@v4 - - name: Download openDAQ framework asset - id: download-framework-filename - uses: openDAQ/actions/framework-download-release@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests + - name: Compose openDAQ framework filename + id: compose-filename + uses: openDAQ/actions/framework-compose-filename@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests with: platform: ${{ matrix.platform-alias }} - github-token: ${{ secrets.PAT_TOKEN }} - - - name: Normalize downloaded asset path - id: normalize-framework-filename - shell: bash - run: | - asset=${{ steps.download-framework-filename.outputs.asset }} - # Normalize output-dir path for cross-platform compatibility - if command -v cygpath >/dev/null 2>&1; then - asset="$(cygpath -w "$asset")" - echo "Normalized path (Windows): $asset" - fi - echo "asset=$asset" >> $GITHUB_OUTPUT + + - name: Download openDAQ framework asset + uses: robinraju/release-downloader@v1 + with: + repository: openDAQ/openDAQ + latest: true + fileName: ${{ steps.compose-filename.outputs.filename }} + out-file-path: downloads - name: Install openDAQ framework asset uses: openDAQ/actions/framework-install@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests with: - framework-filename: ${{ steps.normalize-framework-filename.outputs.asset }} + framework-filename: ${{ github.workspace }}/downloads/${{ steps.compose-filename.outputs.filename }} - name: Build and test simple device module uses: ./.github/actions/module-build-test From 30be55286b5c55596aceb2f531aa0890b7439217 Mon Sep 17 00:00:00 2001 From: Aliaksandr Adziareika <8034372+alexadereyko@users.noreply.github.com> Date: Mon, 24 Nov 2025 18:03:48 +0100 Subject: [PATCH 4/7] Replace framework-install action with install-framework and remove download and compose filename steps --- .github/workflows/ci.yml | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16662fd..76b611a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,24 +32,27 @@ jobs: - name: Checkout simple device module repo uses: actions/checkout@v4 - - name: Compose openDAQ framework filename - id: compose-filename - uses: openDAQ/actions/framework-compose-filename@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests - with: - platform: ${{ matrix.platform-alias }} - - - name: Download openDAQ framework asset - uses: robinraju/release-downloader@v1 - with: - repository: openDAQ/openDAQ - latest: true - fileName: ${{ steps.compose-filename.outputs.filename }} - out-file-path: downloads - - - name: Install openDAQ framework asset - uses: openDAQ/actions/framework-install@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests - with: - framework-filename: ${{ github.workspace }}/downloads/${{ steps.compose-filename.outputs.filename }} + # - name: Compose openDAQ framework filename + # id: compose-filename + # uses: openDAQ/actions/framework-compose-filename@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests + # with: + # platform: ${{ matrix.platform-alias }} + + # - name: Download openDAQ framework asset + # uses: robinraju/release-downloader@v1 + # with: + # repository: openDAQ/openDAQ + # latest: true + # fileName: ${{ steps.compose-filename.outputs.filename }} + # out-file-path: downloads + + # - name: Install openDAQ framework asset + # uses: openDAQ/actions/framework-install@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests + # with: + # framework-filename: ${{ github.workspace }}/downloads/${{ steps.compose-filename.outputs.filename }} + + - name: Install openDAQ framework + uses: openDAQ/actions/install-framework@jira/TBBAS-2871-download-and-install-sdk - name: Build and test simple device module uses: ./.github/actions/module-build-test From 7fd1c52cd20effde3e8c50cddea42c0675d82f7f Mon Sep 17 00:00:00 2001 From: Aliaksandr Adziareika <8034372+alexadereyko@users.noreply.github.com> Date: Mon, 24 Nov 2025 18:08:01 +0100 Subject: [PATCH 5/7] Remove commented code --- .github/workflows/ci.yml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76b611a..9101914 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,17 +14,14 @@ jobs: contents: read actions: read - env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} + # env: + # GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} strategy: fail-fast: false matrix: include: - - os: ubuntu-latest - platform-alias: "ubuntu22.04-x86_64" - - os: windows-latest - platform-alias: "win64" + - os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} @@ -32,25 +29,6 @@ jobs: - name: Checkout simple device module repo uses: actions/checkout@v4 - # - name: Compose openDAQ framework filename - # id: compose-filename - # uses: openDAQ/actions/framework-compose-filename@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests - # with: - # platform: ${{ matrix.platform-alias }} - - # - name: Download openDAQ framework asset - # uses: robinraju/release-downloader@v1 - # with: - # repository: openDAQ/openDAQ - # latest: true - # fileName: ${{ steps.compose-filename.outputs.filename }} - # out-file-path: downloads - - # - name: Install openDAQ framework asset - # uses: openDAQ/actions/framework-install@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests - # with: - # framework-filename: ${{ github.workspace }}/downloads/${{ steps.compose-filename.outputs.filename }} - - name: Install openDAQ framework uses: openDAQ/actions/install-framework@jira/TBBAS-2871-download-and-install-sdk From 8124f763ce88751fe7243f6d0a47595ef168876d Mon Sep 17 00:00:00 2001 From: Aliaksandr Adziareika <8034372+alexadereyko@users.noreply.github.com> Date: Mon, 24 Nov 2025 18:12:10 +0100 Subject: [PATCH 6/7] Remove PAT token --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9101914..da1c195 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,15 +13,11 @@ jobs: permissions: contents: read actions: read - - # env: - # GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} strategy: fail-fast: false matrix: - include: - - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} From ee68e9cfcaecffc718996e8a0fe97458fe55c177 Mon Sep 17 00:00:00 2001 From: Aliaksandr Adziareika <8034372+alexadereyko@users.noreply.github.com> Date: Mon, 24 Nov 2025 18:42:20 +0100 Subject: [PATCH 7/7] Add 32-bits Windows support --- .github/actions/module-build-test/action.yml | 35 ++++++++++++++++---- .github/workflows/ci.yml | 14 ++++++-- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/.github/actions/module-build-test/action.yml b/.github/actions/module-build-test/action.yml index f5e0fb4..58e5bf4 100644 --- a/.github/actions/module-build-test/action.yml +++ b/.github/actions/module-build-test/action.yml @@ -1,29 +1,52 @@ name: Build and test simple device module description: Configure, build and test simple device module with CMake +inputs: + enable-32bit: + description: 'Enable 32-bit build for Windows' + required: false + default: 'false' + runs: using: composite steps: - - name: Set CMake generator + - name: Set CMake generator and architecture + id: cmake-config shell: bash run: | if [[ "${{ runner.os }}" == "Windows" ]]; then - echo "CMAKE_GENERATOR=Visual Studio 17 2022" >> $GITHUB_ENV + echo "cmake-generator=-G \"Visual Studio 17 2022\"" >> $GITHUB_OUTPUT + if [[ "${{ inputs.enable-32bit }}" == "true" ]]; then + echo "cmake-arch=-A Win32" >> $GITHUB_OUTPUT + else + echo "cmake-arch=" >> $GITHUB_OUTPUT + fi else - echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV + echo "cmake-generator=-G Ninja" >> $GITHUB_OUTPUT + echo "cmake-arch=" >> $GITHUB_OUTPUT fi + echo "cmake-build-dir=build" >> $GITHUB_OUTPUT + echo "cmake-config-name=Release" >> $GITHUB_OUTPUT - name: Configure simple device module with CMake shell: bash run: | - cmake -B build/output -S . -G "$CMAKE_GENERATOR" -DEXAMPLE_MODULE_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release + cmake -B ${{ steps.cmake-config.outputs.cmake-build-dir }} -S . \ + ${{ steps.cmake-config.outputs.cmake-generator }} \ + ${{ steps.cmake-config.outputs.cmake-arch }} \ + -DCMAKE_BUILD_TYPE=${{ steps.cmake-config.outputs.cmake-config-name }} \ + -DEXAMPLE_MODULE_ENABLE_TESTS=ON - name: Build simple device module with CMake shell: bash run: | - cmake --build build/output --config Release + cmake --build ${{ steps.cmake-config.outputs.cmake-build-dir }} \ + --config ${{ steps.cmake-config.outputs.cmake-config-name }} - name: Run simple device module tests with CMake shell: bash run: | - ctest --test-dir build/output --output-on-failure -C Release -V + ctest --test-dir ${{ steps.cmake-config.outputs.cmake-build-dir }} \ + --output-on-failure \ + -C ${{ steps.cmake-config.outputs.cmake-config-name }} \ + -V diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da1c195..50d89cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,17 @@ jobs: permissions: contents: read actions: read - + strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + include: + - os: ubuntu-latest + enable-32bit: false + - os: windows-latest + enable-32bit: false + - os: windows-latest + enable-32bit: true runs-on: ${{ matrix.os }} @@ -27,6 +33,10 @@ jobs: - name: Install openDAQ framework uses: openDAQ/actions/install-framework@jira/TBBAS-2871-download-and-install-sdk + with: + enable-32bit: ${{ matrix.enable-32bit }} - name: Build and test simple device module uses: ./.github/actions/module-build-test + with: + enable-32bit: ${{ matrix.enable-32bit }}