|
| 1 | +# |
| 2 | +# Copyright (c) 2024 ZettaScale Technology |
| 3 | +# |
| 4 | +# This program and the accompanying materials are made available under the |
| 5 | +# terms of the Eclipse Public License 2.0 which is available at |
| 6 | +# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 |
| 7 | +# which is available at https://www.apache.org/licenses/LICENSE-2.0. |
| 8 | +# |
| 9 | +# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 |
| 10 | +# |
| 11 | +# Contributors: |
| 12 | +# ZettaScale zenoh Team, <[email protected]> |
| 13 | +# |
| 14 | +name: cpp-check |
| 15 | + |
| 16 | +on: |
| 17 | + push: |
| 18 | + branches: |
| 19 | + - main |
| 20 | + pull_request: |
| 21 | + branches: |
| 22 | + - main |
| 23 | + workflow_dispatch: |
| 24 | + inputs: |
| 25 | + zenoh_cpp_branch: |
| 26 | + description: 'Branch of zenoh-cpp to use' |
| 27 | + required: false |
| 28 | + default: 'main' |
| 29 | + |
| 30 | +jobs: |
| 31 | + build-and-test: |
| 32 | + name: Build and Test zenoh-cpp |
| 33 | + runs-on: ubuntu-24.04 |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: Checkout zenoh-pico |
| 37 | + uses: actions/checkout@v3 |
| 38 | + |
| 39 | + - name: Build zenoh-pico |
| 40 | + run: | |
| 41 | + mkdir build && cd build |
| 42 | + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local |
| 43 | + make install |
| 44 | +
|
| 45 | + - name: Clone zenoh-cpp |
| 46 | + run: | |
| 47 | + git clone https://github.com/eclipse-zenoh/zenoh-cpp.git |
| 48 | + cd zenoh-cpp |
| 49 | + git fetch --all |
| 50 | + git checkout ${{ github.event.inputs.zenoh_cpp_branch || 'main' }} |
| 51 | + git submodule update --init --recursive |
| 52 | +
|
| 53 | + - name: Build zenoh-cpp |
| 54 | + run: | |
| 55 | + cd zenoh-cpp |
| 56 | + mkdir build && cd build |
| 57 | + cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_ZENOHPICO=ON -DWITH_ZENOHC=OFF |
| 58 | + cmake --build . --config Release |
| 59 | +
|
| 60 | + - name: make examples |
| 61 | + run: | |
| 62 | + cd build |
| 63 | + cmake .. -DCMAKE_INSTALL_PREFIX=~/local |
| 64 | + cmake --build . --target examples --config Release |
| 65 | +
|
| 66 | + - name: make tests |
| 67 | + run: | |
| 68 | + cd zenoh-cpp/build |
| 69 | + cmake --build . --target tests --config Release |
| 70 | +
|
| 71 | + - name: run tests |
| 72 | + run: | |
| 73 | + cd zenoh-cpp/build |
| 74 | + ctest -C Release --output-on-failure |
0 commit comments