Skip to content

Commit bcb8377

Browse files
committed
updated ci
1 parent bd15f93 commit bcb8377

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,72 @@ jobs:
4242
- name: Run project tests with CMake
4343
if: matrix.os == 'ubuntu-latest'
4444
run: ctest --test-dir build/output --output-on-failure -C Debug
45+
46+
install-build-and-test:
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
include:
51+
- os: ubuntu-latest
52+
generator: Ninja
53+
- os: windows-latest
54+
generator: "Visual Studio 17 2022"
55+
56+
runs-on: ${{ matrix.os }}
57+
env:
58+
INSTALL_PREFIX: ${{ github.workspace }}/opendaq_install
59+
60+
steps:
61+
- name: Install additional dependencies
62+
if: matrix.os == 'ubuntu-latest'
63+
run: |
64+
sudo apt-get install -y --no-install-recommends mono-runtime libmono-system-json-microsoft4.0-cil libmono-system-data4.0-cil
65+
66+
- name: Checkout module
67+
uses: actions/checkout@v4
68+
with:
69+
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
70+
path: module
71+
72+
- name: Read openDAQ version
73+
shell: bash
74+
working-directory: module
75+
run: |
76+
opendaq_ref=$(cat opendaq_ref)
77+
echo "OPENDAQ_REF=$opendaq_ref" >> $GITHUB_ENV
78+
79+
- name: Checkout openDAQ
80+
uses: actions/checkout@v4
81+
with:
82+
repository: openDAQ/openDAQ
83+
ref: ${{ env.OPENDAQ_REF }}
84+
path: opendaq
85+
86+
- name: Configure, build and install openDAQ
87+
working-directory: opendaq
88+
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
92+
93+
- name: Add DLL path (Windows only)
94+
if: matrix.os == 'windows-latest'
95+
run: echo "${{ env.INSTALL_PREFIX }}/lib" >> $env:GITHUB_PATH
96+
97+
- name: Configure project with CMake
98+
working-directory: module
99+
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/"
100+
101+
- name: Build project with CMake
102+
working-directory: module
103+
run: cmake --build build/output --config Release
104+
105+
- name: Install and run mosquitto Linux
106+
if: matrix.os == 'ubuntu-latest'
107+
run: |
108+
sudo apt-get install -y --no-install-recommends mosquitto
109+
110+
- name: Run project tests with CMake
111+
if: matrix.os == 'ubuntu-latest'
112+
working-directory: module
113+
run: ctest --test-dir build/output --output-on-failure -C Release

0 commit comments

Comments
 (0)