Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ci workflow to build and test #14

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: ["**"]
workflow_call:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main

- name: Conan version
run: echo "${{ steps.conan.outputs.version }}"


- name: Create default Conan profile
run: conan profile detect

- name: Install Rust toolchain
run: rustup component add rustfmt clippy

- name: Create up-cpp Conan package
shell: bash
run: |
git clone https://github.com/eclipse-uprotocol/up-cpp.git
cd up-cpp
git clone -b uprotocol-core-api-1.5.6 https://github.com/eclipse-uprotocol/up-core-api.git
git submodule update --init --recursive
conan create . --build=missing

- name: Build and install Zenoh-C
shell: bash
run: |
git clone https://github.com/eclipse-zenoh/zenoh-c.git
cd zenoh-c && mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local
cmake --build . --target install --config Release -- -j

- name: Build && install up-client-zenoh-cpp
shell: bash
run: |
conan install conaninfo/ --output-folder=.
cd build/Release
cmake ../../ -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local
cmake --build . --target install --config Release -- -j



# NOTE: In GitHub repository settings, the "Require status checks to pass
# before merging" branch protection rule ensures that commits are only merged
# from branches where specific status checks have passed. These checks are
# specified manually as a list of workflow job names. Thus we use this extra
# job to signal whether all CI checks have passed.
ci:
name: CI status checks
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Check whether all jobs pass
run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")'
3 changes: 3 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ else()
find_package(spdlog REQUIRED)
endif()

# Support pulling headers outside of /usr/local
include_directories(${CMAKE_INSTALL_PREFIX}/include)

add_definitions(-DSPDLOG_FMT_EXTERNAL)

set(SRC_FILES
Expand Down