Skip to content

zchrissirhcz/HelloCpp

Repository files navigation

HelloCpp

badges

item badge how to setup
license GitHub https://shields.io/category/license
linux-aarch64 linux-aarch64 https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge
linux-x64 linux-x64 https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge
win-x64 win-x64 https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge
mac-x64 mac-x64 https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge
travis arm64 Build Status https://docs.travis-ci.com/user/status-images/#travis-ci-pages-show-the-default-branchs-result
codecov codecov https://stackoverflow.com/questions/54010651/how-to-display-codecov-io-badge-in-github-readme-md
GH release download GitHub all releases downloads https://shields.io/category/downloads

Features / Plans

This is an example C++ project with features:

  • Building

    • Linux-aarch64 (with QEMU)
    • Linux x64
    • MacOSX x64
    • Windows x64
    • Android ARMv8
  • Configuration

    • version.h generated by cmake configure file
    • Macro definitions generated by options and cmake configure file
    • Create imported target in helloConfig.cmake, together with global variables
  • Testing

    • Use GoogleTest for C++ unittest
    • Integrate GoogleTest with CMake
    • GCC compiler test coverage report
    • Clang compiler test coverage report
    • CodeCov integration for CI coverage display
    • gcovr integration
    • Visual Studio Community: use OpenCppCoverage plugin
  • Installing

    • Create static library and executable targets
    • Providing helloConfig.cmake for further find_package(hello)
    • Installed helloConfig.cmake with portable prefix instead of hard-coded
    • helloConfig.cmake handle release/debug modes separately by postfix _d
    • Example project demonstrate how find_package(hello) use
    • Create shared library for Linux, Android and Windows platforms
  • CI / CD

    • Github Action
      • build and test after each commit pushed
      • provide artifactory download after each build
      • automatically upload and publish and release
    • TravisCI arm64 build
  • Using

    • Example cmake-based project with find_package()

If your target feature is not listed above, you may create a issue for that.

Local usage

Linux/macOSX

git clone https://github.com/zchrissirhcz/HelloCpp
cd HelloCpp

mkdir build && cd build
cmake ..
cmake --build .

make test
make coverage

cd coverage_report
python -m http.server 7082

Visual Studio

Use cmake generate .sln file, run test, then switch to OpenCppCoverage plugin's output page:

About

Learn CI/CD by doing.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published