Skip to content

Commit

Permalink
Merge pull request #235 from gregmedd/release/1.0.0/stage-merge-to-main
Browse files Browse the repository at this point in the history
Merge changes for 1.0.0 release back from v1.0_up-v1.6.0 branch to main
  • Loading branch information
gregmedd authored Jul 15, 2024
2 parents 415ab7c + b12c4dd commit eef86fe
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 80 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ jobs:
- name: Build up-core-api conan package
shell: bash
run: |
conan create --version 1.5.8 up-conan-recipes/up-core-api/developer
conan create --version 1.6.0 up-conan-recipes/up-core-api/release
- name: Build up-cpp with tests
shell: bash
run: |
cd up-cpp
conan install . --build=missing
cd build
cmake -S .. -DCMAKE_TOOLCHAIN_FILE=Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=yes
conan install --build=missing .
cmake --preset conan-release -DCMAKE_EXPORT_COMPILE_COMMANDS=yes
cd build/Release
cmake --build . -- -j
- name: Save conan cache to archive
Expand All @@ -59,13 +59,13 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: up-cpp/build
path: up-cpp/build/Release

- name: Upload compile commands
uses: actions/upload-artifact@v4
with:
name: compile-commands
path: up-cpp/build/compile_commands.json
path: up-cpp/build/Release/compile_commands.json

- name: Upload conan cache for linting
uses: actions/upload-artifact@v4
Expand All @@ -83,12 +83,12 @@ jobs:
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: up-cpp/build
path: up-cpp/build/Release

- name: Run all tests
shell: bash
run: |
cd up-cpp/build
cd up-cpp/build/Release
chmod +x bin/*
ctest
Expand All @@ -97,7 +97,7 @@ jobs:
if: success() || failure()
with:
name: test-results
path: 'up-cpp/build/test/results/*.xml'
path: 'up-cpp/build/Release/test/results/*.xml'

# NOTE: Run dynamic analysis in unit tests
memcheck:
Expand All @@ -110,7 +110,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: up-cpp/build
path: up-cpp/build/Release

- name: Install Valgrind
run: |
Expand All @@ -120,7 +120,7 @@ jobs:
- name: Run Valgrind Memcheck
continue-on-error: true
run: |
cd up-cpp/build
cd up-cpp/build/Release
chmod +x bin/*
mkdir -p valgrind_logs
: > valgrind_logs/valgrind_memcheck_summary.log
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
if: success() || failure()
with:
name: valgrind-memcheck-log
path: up-cpp/build/valgrind_logs/valgrind_complete_memcheck_log.log
path: up-cpp/build/Release/valgrind_logs/valgrind_complete_memcheck_log.log

threadcheck:
name: Run Valgrind ThreadCheck
Expand All @@ -178,7 +178,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: up-cpp/build
path: up-cpp/build/Release

- name: Install Valgrind
run: |
Expand All @@ -188,7 +188,7 @@ jobs:
- name: Run Valgrind ThreadCheck
continue-on-error: true
run: |
cd up-cpp/build
cd up-cpp/build/Release
chmod +x bin/*
mkdir -p valgrind_logs
: > valgrind_logs/valgrind_threadcheck_summary.log
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
if: success() || failure()
with:
name: valgrind-threadcheck-log
path: up-cpp/build/valgrind_logs/valgrind_complete_threadcheck_log.log
path: up-cpp/build/Release/valgrind_logs/valgrind_complete_threadcheck_log.log

helgrind:
name: Run Valgrind Helgrind
Expand All @@ -247,7 +247,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: up-cpp/build
path: up-cpp/build/Release

- name: Install Valgrind
run: |
Expand All @@ -257,7 +257,7 @@ jobs:
- name: Run Valgrind Helgrind
continue-on-error: true
run: |
cd up-cpp/build
cd up-cpp/build/Release
chmod +x bin/*
mkdir -p valgrind_logs
: > valgrind_logs/valgrind_helgrind_summary.log
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
if: success() || failure()
with:
name: valgrind-helgrind-log
path: up-cpp/build/valgrind_logs/valgrind_complete_helgrind_log.log
path: up-cpp/build/Release/valgrind_logs/valgrind_complete_helgrind_log.log

dhat:
name: Run Valgrind DHAT
Expand All @@ -316,7 +316,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: up-cpp/build
path: up-cpp/build/Release

- name: Install Valgrind
run: |
Expand All @@ -326,7 +326,7 @@ jobs:
- name: Run Valgrind DHAT
continue-on-error: true
run: |
cd up-cpp/build
cd up-cpp/build/Release
chmod +x bin/*
mkdir -p valgrind_logs
: > valgrind_logs/valgrind_dhat_summary.log
Expand Down Expand Up @@ -373,7 +373,7 @@ jobs:
if: success() || failure()
with:
name: valgrind-dhat-log
path: up-cpp/build/valgrind_logs/valgrind_complete_dhat_log.log
path: up-cpp/build/Release/valgrind_logs/valgrind_complete_dhat_log.log

lint:
name: Lint C++ sources
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ jobs:
name: Build up-core-api conan package
shell: bash
run: |
conan create --version 1.5.8 up-conan-recipes/up-core-api/developer
conan create --version 1.6.0 up-conan-recipes/up-core-api/release
- if: matrix.build-mode == 'manual'
name: Build up-cpp with tests
shell: bash
run: |
cd up-cpp
conan install . --build=missing
cd build
cmake -S .. -DCMAKE_TOOLCHAIN_FILE=Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=yes
conan install --build=missing .
cmake --preset conan-release -DCMAKE_EXPORT_COMPILE_COMMANDS=yes
cd build/Release
cmake --build . -- -j
- name: Perform CodeQL Analysis
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
test:
name: Generate Test Coverage eport
name: Generate Test Coverage Report
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -37,37 +37,37 @@ jobs:
uses: actions/checkout@v4
with:
path: up-conan-recipes
repository: gregmedd/up-conan-recipes
repository: eclipse-uprotocol/up-conan-recipes

- name: Build up-core-api conan package
shell: bash
run: |
conan create --version 1.5.8 up-conan-recipes/up-core-api/developer
conan create --version 1.6.0 up-conan-recipes/up-core-api/release
- name: Build up-cpp with tests
shell: bash
run: |
cd up-cpp
conan install . --build=missing
cd build
cmake -S .. -DCMAKE_TOOLCHAIN_FILE=Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Coverage
conan install --build=missing .
cd build/Release
cmake -S ../../ -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Coverage
cmake --build . -- -j
- name: Run all tests
shell: bash
run: |
cd up-cpp/build
cd up-cpp/build/Release
chmod +x bin/*
ctest || true
- name: Run Coverage report
shell: bash
run: |
cd up-cpp/build/
mkdir -p ./Coverage
gcovr -r .. --html --html-details -o ./Coverage/index.html -e '.*test.*'
cd up-cpp/build/Release
mkdir -p ../Coverage
gcovr -r ../../ --html --html-details -o ../Coverage/index.html -e '.*test.*'
cd ..
echo "Coverage report can be found here: ./Coverage/index.html"
echo "Coverage report can be found here: ../Coverage/index.html"
- name: Extract and Print Coverage Percentage
shell: bash
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Upload test results
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: success() || failure()
with:
Expand Down
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.10.0)
project(up-cpp VERSION 0.1.5 LANGUAGES CXX DESCRIPTION "C++ API for uProtocol")
project(up-cpp VERSION 1.1.0 LANGUAGES CXX DESCRIPTION "C++ API for uProtocol")

find_package(protobuf REQUIRED)
find_package(spdlog REQUIRED)
Expand All @@ -36,9 +36,6 @@ if(CMAKE_BUILD_TYPE STREQUAL Coverage)
endif()
message("* Current Compiler Flags: ${CMAKE_CXX_FLAGS}")

# TODO NEEDED?
#add_definitions(-DSPDLOG_FMT_EXTERNAL)

# This is the root CMakeLists.txt file; We can set project wide settings here
# TODO: Is this needed?
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
14 changes: 0 additions & 14 deletions CONTRIBUTORS.adoc

This file was deleted.

8 changes: 1 addition & 7 deletions NOTICE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,5 @@ SPDX-License-Identifier: Apache-2.0

The following are libraries used by this project:

* http://cloudevents.io
* https://github.com/google/googletest
* http://protobuf.dev
* https://github.com/openssl/openssl
* https://github.com/topics/libuuid
* https://github.com/Tencent/rapidjson
* https://github.com/gabime/spdlog
* https://github.com/cgreen-devs/cgreen
* https://github.com/google/googletest
36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# uProtocol C++ Interface Library (up-cpp)

[![CI](https://github.com/eclipse-uprotocol/up-cpp/actions/workflows/ci.yml/badge.svg)](https://github.com/eclipse-uprotocol/up-cpp/actions/workflows/ci.yml)

## Welcome!

This library provides the primary interface to uProtocol for uEntity
Expand All @@ -22,7 +24,7 @@ implementation, such as [up-transport-zenoh-cpp][zenoh-transport-repo].
Using the recipes found in [up-conan-recipes][conan-recipe-repo], build these
Conan packages:

1. [up-core-api][spec-repo]: `conan create --version 1.5.8 --build=missing up-core-api/developer`
1. [up-core-api][spec-repo]: `conan create --version 1.6.0 --build=missing up-core-api/release`

**NOTE:** all `conan` commands in this document use Conan 2.x syntax. Please
adjust accordingly when using Conan 1.x.
Expand All @@ -34,7 +36,7 @@ To add up-cpp to your conan build dependencies, place following in your

```
[requires]
up-cpp/0.2.0
up-cpp/[~1.0]
[generators]
CMakeDeps
Expand All @@ -56,30 +58,38 @@ up-cpp, If you are making a project that uses up-cpp, follow the steps in the

### With Conan for dependencies

Clone the up-cpp repo to a folder named: up-cpp
From the root of this repo, run:

```
cd up-cpp
conan install .
cd build
cmake ../ -DCMAKE_TOOLCHAIN_FILE=Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
```bash
conan install --build=missing .
cmake --preset conan-release
cd build/Release
cmake --build . -- -j
```

Once the build completes, tests can be run with `ctest`.

### Generate UT Coverage
Debug builds can be generated by changing those steps to:

To get code coverage, perform the steps above, but use the following cmake line instead
```bash
conan install --build=missing --settings=build_type=Debug .
cmake --preset conan-debug
cd build/Debug
cmake --build . -- -j
```
cmake ../ -DCMAKE_TOOLCHAIN_FILE=Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Coverage

### Generate UT Coverage

To get code coverage, perform the steps above, but replace `cmake --preset...` with
```
cd build/Release
cmake ../../ -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Coverage
```
Once the tests complete, the Unit Test Coverage report can be generated from the base up-cpp folder with: ./Coverage.sh
```
./coverage.sh
```


### With dependencies installed as system libraries

**TODO** Verify steps for pure cmake build without Conan.
Expand All @@ -96,4 +106,4 @@ Give a ⭐️ if this project helped you!
[conan-recipe-repo]: https://github.com/eclipse-uprotocol/up-conan-recipes
[spec-repo]: https://github.com/eclipse-uprotocol/up-spec
[conan-abi-docs]: https://docs.conan.io/en/1.60/howtos/manage_gcc_abi.html
[conan-txt-reference]: https://docs.conan.io/2/reference/conanfile_txt.html
[conan-txt-reference]: https://docs.conan.io/2/reference/conanfile_txt.html
9 changes: 4 additions & 5 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[requires]
up-core-api/1.5.8
spdlog/1.13.0
# Should result in using the one from up-core-api
protobuf/[>3.21.11]
up-core-api/[~1.6]
spdlog/[~1.13]
protobuf/[~3.21]

[test_requires]
gtest/1.14.0
gtest/[~1.14]

[generators]
CMakeDeps
Expand Down

0 comments on commit eef86fe

Please sign in to comment.