<TBBAS-2530> Add example module ci #21
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test example module | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - jira/* | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y git wget cmake ninja-build mono-complete g++ libgmock-dev | |
| wget -v https://docs.opendaq.com/download/SDK/opendaq-3.20.4-ubuntu22.04-x86_64.deb -O /tmp/opendaq.deb | |
| sudo dpkg -i /tmp/opendaq.deb || sudo apt-get install -f -y | |
| - name: Configure CMake | |
| run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: cmake --build build/output --target all | |
| - name: Run tests with GTest report | |
| run: | | |
| mkdir -p build/reports | |
| export GTEST_OUTPUT=xml:$(pwd)/build/reports/gtest-report.xml | |
| ctest --test-dir build/output --output-on-failure -V | |
| - name: Upload test report artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gtest-report | |
| path: build/reports/gtest-report.xml |