11name : Build and Test
22
33on :
4+ workflow_dispatch :
5+ inputs :
6+ opendaq_ref :
7+ description : " openDAQ SDK commit, branch or tag"
8+ required : false
9+ default : " "
410 pull_request :
511 types : [opened, reopened, synchronize, ready_for_review]
612
1218 include :
1319 - os : ubuntu-latest
1420 generator : Ninja
21+ build_type : Debug
1522 - os : windows-latest
1623 generator : " Visual Studio 17 2022"
24+ build_type : Debug
25+ - os : ubuntu-latest
26+ generator : Ninja
27+ build_type : Release
28+ - os : windows-latest
29+ generator : " Visual Studio 17 2022"
30+ build_type : Release
1731
1832 runs-on : ${{ matrix.os }}
1933
@@ -28,11 +42,15 @@ jobs:
2842 with :
2943 ref : ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
3044
45+ - name : Overwrite opendaq_ref
46+ if : ${{ github.event.inputs.opendaq_ref != '' }}
47+ run : echo "${{ github.event.inputs.opendaq_ref }}" > opendaq_ref
48+
3149 - name : Configure project with CMake
32- run : cmake -B build/output -S . -G "${{ matrix.generator }}" -DOPENDAQ_MQTT_ENABLE_TESTS =ON -DCMAKE_BUILD_TYPE=Debug
50+ run : cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_MQTT_ENABLE_TESTS =ON -DDAQMODULES_MQTT_DEBUG_WARNINGS_AS_ERRORS=ON -DOPENDAQ_DEBUG_WARNINGS_AS_ERRORS=ON - DCMAKE_BUILD_TYPE="${{ matrix.build_type }}"
3351
3452 - name : Build project with CMake
35- run : cmake --build build/output --config Debug
53+ run : cmake --build build/output --config "${{ matrix.build_type }}"
3654
3755 - name : Install and run mosquitto Linux
3856 if : matrix.os == 'ubuntu-latest'
@@ -41,17 +59,25 @@ jobs:
4159
4260 - name : Run project tests with CMake
4361 if : matrix.os == 'ubuntu-latest'
44- run : ctest --test-dir build/output --output-on-failure -C Debug
45-
62+ run : ctest --test-dir build/output --output-on-failure -C "${{ matrix.build_type }}"
63+
4664 install-build-and-test :
4765 strategy :
4866 fail-fast : false
4967 matrix :
5068 include :
5169 - os : ubuntu-latest
5270 generator : Ninja
71+ build_type : Debug
5372 - os : windows-latest
5473 generator : " Visual Studio 17 2022"
74+ build_type : Debug
75+ - os : ubuntu-latest
76+ generator : Ninja
77+ build_type : Release
78+ - os : windows-latest
79+ generator : " Visual Studio 17 2022"
80+ build_type : Release
5581
5682 runs-on : ${{ matrix.os }}
5783 env :
6995 ref : ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
7096 path : module
7197
98+ - name : Overwrite opendaq_ref
99+ if : ${{ github.event.inputs.opendaq_ref != '' }}
100+ working-directory : module
101+ run : echo "${{ github.event.inputs.opendaq_ref }}" > opendaq_ref
102+
72103 - name : Read openDAQ version
73104 shell : bash
74105 working-directory : module
@@ -86,28 +117,28 @@ jobs:
86117 - name : Configure, build and install openDAQ
87118 working-directory : opendaq
88119 run : |
89- cmake -B build/output -S . -G "${{ matrix.generator }}" -DOPENDAQ_ENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_PREFIX }}"
90- cmake --build build/output --config Release
91- cmake --install build/output --config Release
120+ cmake -B build/output -S . -G "${{ matrix.generator }}" -DOPENDAQ_ENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_PREFIX }}"
121+ cmake --build build/output --config "${{ matrix.build_type }}"
122+ cmake --install build/output --config "${{ matrix.build_type }}"
92123
93124 - name : Add DLL path (Windows only)
94125 if : matrix.os == 'windows-latest'
95126 run : echo "${{ env.INSTALL_PREFIX }}/lib" >> $env:GITHUB_PATH
96127
97128 - name : Configure project with CMake
98129 working-directory : module
99- run : cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_MQTT_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DopenDAQ_DIR="${{ env.INSTALL_PREFIX }}/lib/cmake/opendaq/"
130+ run : cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_MQTT_ENABLE_TESTS=ON -DDAQMODULES_MQTT_DEBUG_WARNINGS_AS_ERRORS=ON - DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DopenDAQ_DIR="${{ env.INSTALL_PREFIX }}/lib/cmake/opendaq/"
100131
101132 - name : Build project with CMake
102133 working-directory : module
103- run : cmake --build build/output --config Release
134+ run : cmake --build build/output --config "${{ matrix.build_type }}"
104135
105136 - name : Install and run mosquitto Linux
106137 if : matrix.os == 'ubuntu-latest'
107138 run : |
108139 sudo apt-get install -y --no-install-recommends mosquitto
109-
140+
110141 - name : Run project tests with CMake
111142 if : matrix.os == 'ubuntu-latest'
112143 working-directory : module
113- run : ctest --test-dir build/output --output-on-failure -C Release
144+ run : ctest --test-dir build/output --output-on-failure -C "${{ matrix.build_type }}"
0 commit comments