From e811ddff3dc87b9533e69074bc532bd836fea3d1 Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Mon, 25 Nov 2024 16:09:12 +0100 Subject: [PATCH] Add CPP check CI workflow --- .github/workflows/cpp-check.yaml | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/cpp-check.yaml diff --git a/.github/workflows/cpp-check.yaml b/.github/workflows/cpp-check.yaml new file mode 100644 index 000000000..64e38b753 --- /dev/null +++ b/.github/workflows/cpp-check.yaml @@ -0,0 +1,74 @@ +# +# Copyright (c) 2024 ZettaScale Technology +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +# which is available at https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +# +# Contributors: +# ZettaScale zenoh Team, +# +name: cpp-check + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + inputs: + zenoh_cpp_branch: + description: 'Branch of zenoh-cpp to use' + required: false + default: 'main' + +jobs: + build-and-test: + name: Build and Test zenoh-cpp + runs-on: ubuntu-24.04 + + steps: + - name: Checkout zenoh-pico + uses: actions/checkout@v3 + + - name: Build zenoh-pico + run: | + mkdir build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local + make install + + - name: Clone zenoh-cpp + run: | + git clone https://github.com/eclipse-zenoh/zenoh-cpp.git + cd zenoh-cpp + git fetch --all + git checkout ${{ github.event.inputs.zenoh_cpp_branch || 'main' }} + git submodule update --init --recursive + + - name: Build zenoh-cpp + run: | + cd zenoh-cpp + mkdir build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DZENOHCXX_ZENOHPICO=ON -DZENOHCXX_ZENOHC=OFF + cmake --build . --config Release + + - name: make examples + run: | + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=~/local + cmake --build . --target examples --config Release + + - name: make tests + run: | + cd zenoh-cpp/build + cmake --build . --target tests --config Release + + - name: run tests + run: | + cd zenoh-cpp/build + ctest -C Release --output-on-failure