Skip to content
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
41 changes: 41 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -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
103 changes: 94 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,98 @@
# Generic Embedded Software Library
## EmbeddedLib: Generic Embedded Software Library
[![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.

### 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 .

```
mkdir build && cd build
```

- test build:

```
cmake -DTARGET_GROUP=test ..
cmake --build .
ctest
```

- production build:

```
cmake -DTARGET_GROUP=production ..
cmake --build .
```

### JFrog configuration
<jfrog-artifactory-token>

#### 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 <jfrog-artifactory-token> emilcode-conan <username/email>
```

### JFrog Upload
Upload a Conan (Conan 2) recipe and its binary packages using the following command:

```
conan upload "*" --remote=emilcode-conan --confirm
```

<RECIPE> is the Conan recipe reference you want to upload in the format: <NAME>/<VERSION>@<USER>/<CHANNEL>
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