Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 40 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Build and Test

on:
workflow_dispatch:
inputs:
opendaq_ref:
description: "openDAQ SDK commit, branch or tag"
required: false
default: ""
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

Expand All @@ -12,8 +18,16 @@ jobs:
include:
- os: ubuntu-latest
generator: Ninja
build_type: Debug
- os: windows-latest
generator: "Visual Studio 17 2022"
build_type: Debug
- os: ubuntu-latest
generator: Ninja
build_type: Release
- os: windows-latest
generator: "Visual Studio 17 2022"
build_type: Release

runs-on: ${{ matrix.os }}

Expand All @@ -28,14 +42,18 @@ jobs:
with:
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}

- name: Overwrite opendaq_ref
if: ${{ github.event.inputs.opendaq_ref != '' }}
run: echo "${{ github.event.inputs.opendaq_ref }}" > opendaq_ref

- name: Configure project with CMake
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_OPCUA_ENABLE_TESTS=ON -DDAQMODULES_OPCUA_DEBUG_WARNINGS_AS_ERRORS=ON -DCMAKE_BUILD_TYPE=Debug
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_OPCUA_ENABLE_TESTS=ON -DDAQMODULES_OPCUA_DEBUG_WARNINGS_AS_ERRORS=ON -DOPENDAQ_DEBUG_WARNINGS_AS_ERRORS=ON -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}"

- name: Build project with CMake
run: cmake --build build/output --config Debug
run: cmake --build build/output --config "${{ matrix.build_type }}"

- name: Run project tests with CMake
run: ctest --test-dir build/output --output-on-failure -C Debug
run: ctest --test-dir build/output --output-on-failure -C "${{ matrix.build_type }}"

install-build-and-test:
strategy:
Expand All @@ -44,8 +62,16 @@ jobs:
include:
- os: ubuntu-latest
generator: Ninja
build_type: Debug
- os: windows-latest
generator: "Visual Studio 17 2022"
build_type: Debug
- os: ubuntu-latest
generator: Ninja
build_type: Release
- os: windows-latest
generator: "Visual Studio 17 2022"
build_type: Release

runs-on: ${{ matrix.os }}
env:
Expand All @@ -63,6 +89,11 @@ jobs:
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
path: module

- name: Overwrite opendaq_ref
if: ${{ github.event.inputs.opendaq_ref != '' }}
working-directory: module
run: echo "${{ github.event.inputs.opendaq_ref }}" > opendaq_ref

- name: Read openDAQ version
shell: bash
working-directory: module
Expand All @@ -80,22 +111,22 @@ jobs:
- name: Configure, build and install openDAQ
working-directory: opendaq
run: |
cmake -B build/output -S . -G "${{ matrix.generator }}" -DOPENDAQ_ENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_PREFIX }}"
cmake --build build/output --config Release
cmake --install build/output --config Release
cmake -B build/output -S . -G "${{ matrix.generator }}" -DOPENDAQ_ENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_PREFIX }}"
cmake --build build/output --config "${{ matrix.build_type }}"
cmake --install build/output --config "${{ matrix.build_type }}"

- name: Add DLL path (Windows only)
if: matrix.os == 'windows-latest'
run: echo "${{ env.INSTALL_PREFIX }}/lib" >> $env:GITHUB_PATH

- name: Configure project with CMake
working-directory: module
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_OPCUA_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DopenDAQ_DIR="${{ env.INSTALL_PREFIX }}/lib/cmake/opendaq/"
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_OPCUA_ENABLE_TESTS=ON -DDAQMODULES_OPCUA_DEBUG_WARNINGS_AS_ERRORS=ON -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DopenDAQ_DIR="${{ env.INSTALL_PREFIX }}/lib/cmake/opendaq/"

- name: Build project with CMake
working-directory: module
run: cmake --build build/output --config Release
run: cmake --build build/output --config "${{ matrix.build_type }}"

- name: Run project tests with CMake
working-directory: module
run: ctest --test-dir build/output --output-on-failure -C Release
run: ctest --test-dir build/output --output-on-failure -C "${{ matrix.build_type }}"
Loading