Skip to content

Commit 08a012d

Browse files
author
Steven Hartley
authored
Adding ci workflow to build and test (#14)
* Adding ci workflow to build and test * add core-api to up-cpp * Fix the build for github ci workflow
1 parent bd2a474 commit 08a012d

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: ["**"]
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Conan
20+
id: conan
21+
uses: turtlebrowser/get-conan@main
22+
23+
- name: Conan version
24+
run: echo "${{ steps.conan.outputs.version }}"
25+
26+
27+
- name: Create default Conan profile
28+
run: conan profile detect
29+
30+
- name: Install Rust toolchain
31+
run: rustup component add rustfmt clippy
32+
33+
- name: Create up-cpp Conan package
34+
shell: bash
35+
run: |
36+
git clone https://github.com/eclipse-uprotocol/up-cpp.git
37+
cd up-cpp
38+
git clone -b uprotocol-core-api-1.5.6 https://github.com/eclipse-uprotocol/up-core-api.git
39+
git submodule update --init --recursive
40+
conan create . --build=missing
41+
42+
- name: Build and install Zenoh-C
43+
shell: bash
44+
run: |
45+
git clone https://github.com/eclipse-zenoh/zenoh-c.git
46+
cd zenoh-c && mkdir -p build && cd build
47+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local
48+
cmake --build . --target install --config Release -- -j
49+
50+
- name: Build && install up-client-zenoh-cpp
51+
shell: bash
52+
run: |
53+
conan install conaninfo/ --output-folder=.
54+
cd build/Release
55+
cmake ../../ -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local
56+
cmake --build . --target install --config Release -- -j
57+
58+
59+
60+
# NOTE: In GitHub repository settings, the "Require status checks to pass
61+
# before merging" branch protection rule ensures that commits are only merged
62+
# from branches where specific status checks have passed. These checks are
63+
# specified manually as a list of workflow job names. Thus we use this extra
64+
# job to signal whether all CI checks have passed.
65+
ci:
66+
name: CI status checks
67+
runs-on: ubuntu-latest
68+
needs: build
69+
if: always()
70+
steps:
71+
- name: Check whether all jobs pass
72+
run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")'

lib/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ else()
2929
find_package(spdlog REQUIRED)
3030
endif()
3131

32+
# Support pulling headers outside of /usr/local
33+
include_directories(${CMAKE_INSTALL_PREFIX}/include)
34+
3235
add_definitions(-DSPDLOG_FMT_EXTERNAL)
3336

3437
set(SRC_FILES

0 commit comments

Comments
 (0)