From ebc631995762d83cc31f0607872563119b4f52eb Mon Sep 17 00:00:00 2001 From: emilcode Date: Tue, 2 Sep 2025 15:31:36 +0000 Subject: [PATCH 1/3] [added] instructions and description to readme --- README.md | 103 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 94 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index edad366..e0aa276 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,98 @@ -# Generic Embedded Software Library +## EmbeddedLib: Generic Embedded Software Library +[![Embedded Lib Conan Package](https://github.com/emilcode-dev/embedded-lib/actions/workflows/publish-package.yml/badge.svg)](https://github.com/emilcode-dev/embedded-lib/actions/workflows/publish-package.yml) +[![Build Devcontainer Image](https://github.com/emilcode-dev/embedded-lib/actions/workflows/devcontainer.yml/badge.svg)](https://github.com/emilcode-dev/embedded-lib/actions/workflows/devcontainer.yml) + +EmbeddedLib is a modular C/C++ library designed for embedded software projects. It provides reusable components, build/test automation with CMake, and packaging via Conan. The repository supports both development and production builds, integrates with JFrog Artifactory for package management, and includes documentation generation tools. This project aims to streamline embedded development workflows and promote code reuse across projects. + +### Developer guide * run docker * run dev container in vs code * build project - mkdir build && cd build - - test: - cmake -DTARGET_GROUP=test .. - cmake --build . - ctest - - production: - cmake -DTARGET_GROUP=production .. - cmake --build . \ No newline at end of file + +``` +mkdir build && cd build +``` + +- test build: + +``` +cmake -DTARGET_GROUP=test .. +cmake --build . +ctest +``` + +- production build: + +``` +cmake -DTARGET_GROUP=production .. +cmake --build . +``` + +### JFrog configuration + + +#### Add artifactory repository to client configuration +``` +conan remote add emilcode-conan https://emilcodedev.jfrog.io/artifactory/api/conan/emilcode-conan +``` + +#### Login to the artifactory (Conan V2.x and up), client documentation found here: docs.conan.io + +``` +conan remote login -p emilcode-conan +``` + +### JFrog Upload +Upload a Conan (Conan 2) recipe and its binary packages using the following command: + +``` +conan upload "*" --remote=emilcode-conan --confirm +``` + + is the Conan recipe reference you want to upload in the format: /@/ +For example: lib/1.0@conan/stable + + +### Build library + +``` +conan profile detect --name=profile_build_detected +conan install . --build missing --profile:build=profile_build_detected --profile:host=profile_build_detected +``` + +#### Activate the build environment so that we use the selected CMake version for building + +``` +source build/Release/generators/conanbuild.sh +``` + +#### Build our application + +``` +cmake --preset=conan-release +cmake --build --preset=conan-release +``` + +### Build and Run Unittests + +Unity is used in this project as unittesting framework. + +``` +mkdir build && cd build +cmake -DTARGET_GROUP=test .. +cmake --build . +ctest +``` + +### Create documentation + +``` +cd doc +doxygen Doxyfile +sphinx-build ./source ./build +``` + +### Outlook + +- [ ] Add \ No newline at end of file From 0593eec3b8c4493bff62bd5b775617cd0c04084f Mon Sep 17 00:00:00 2001 From: emilcode Date: Tue, 2 Sep 2025 15:45:45 +0000 Subject: [PATCH 2/3] [update] merge main --- .github/workflows/build-test.yml | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/build-test.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..a04bf7e --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,41 @@ +name: Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + build-and-test: + runs-on: ubuntu-latest + container: + image: ghcr.io/${{ github.repository_owner }}/embedded-lib-dev:latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check environment + run: | + cmake --version + gcc --version + + - name: Create build directory + run: mkdir build + + - name: Configure CMake + run: cmake -DTARGET_GROUP=test .. + working-directory: ./build + + - name: Build tests + run: cmake --build . + working-directory: ./build + + - name: Run tests + run: ctest --output-on-failure + working-directory: ./build \ No newline at end of file From e825042e20e6ad444d3f520366d4b8bc318699e4 Mon Sep 17 00:00:00 2001 From: emilcode Date: Tue, 2 Sep 2025 15:47:07 +0000 Subject: [PATCH 3/3] [changed] link to test action instead of packaging and publishing --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0aa276..c88c875 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## EmbeddedLib: Generic Embedded Software Library -[![Embedded Lib Conan Package](https://github.com/emilcode-dev/embedded-lib/actions/workflows/publish-package.yml/badge.svg)](https://github.com/emilcode-dev/embedded-lib/actions/workflows/publish-package.yml) +[![Tests](https://github.com/emilcode-dev/embedded-lib/actions/workflows/build-test.yml/badge.svg)](https://github.com/emilcode-dev/embedded-lib/actions/workflows/build-test.yml) [![Build Devcontainer Image](https://github.com/emilcode-dev/embedded-lib/actions/workflows/devcontainer.yml/badge.svg)](https://github.com/emilcode-dev/embedded-lib/actions/workflows/devcontainer.yml) EmbeddedLib is a modular C/C++ library designed for embedded software projects. It provides reusable components, build/test automation with CMake, and packaging via Conan. The repository supports both development and production builds, integrates with JFrog Artifactory for package management, and includes documentation generation tools. This project aims to streamline embedded development workflows and promote code reuse across projects.