Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP-IDF Component Continuous Integration #229

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
25 changes: 25 additions & 0 deletions .github/workflows/esp_dry_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow only runs when it is manually dispatched using GitHub.
# It does a dry-run of publishing this project to the ESP component registry.
# The project won't actually be published.

name: Dry-run ESP-IDF component upload.
on:
workflow_dispatch:

jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Dry-run upload to the ESP component registry
uses: espressif/upload-components-ci-action@v1
with:
dry_run: True
name: "libcanard"
# Meaningless version for the purpose of dry run.
version: "0.0.0"
namespace: "opencyphal"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/esp_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow gets triggered when a GitHub release is published.
# It publishes this project to the ESP component registry.

name: Publish component to https://components.espressif.com
on:
release:
types: [published]

jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Upload to the ESP component registry
uses: espressif/upload-components-ci-action@v1
with:
name: "libcanard"
version: ${{ github.event.release.tag_name }}
namespace: "opencyphal"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
17 changes: 17 additions & 0 deletions CMakeLists.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to hide CMakeLists.txt, Kconfig, and idf_component.yml into a subdirectory, or at least the first two? I don't want to pollute the project root with third-party items.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be doable via repository_info

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file sets up builds if libcanard is used
# as an ESP-IDF component.

idf_component_register(SRCS "libcanard/canard.c"
INCLUDE_DIRS "libcanard/")

# Apply the Kconfig options to the source file.

if(NOT CONFIG_CANARD_ASSERTIONS)
target_compile_definitions(${COMPONENT_LIB} PRIVATE "CANARD_ASSERT=(void)")
endif()

if(CONFIG_CANARD_CRC_TABLE)
target_compile_definitions(${COMPONENT_LIB} PRIVATE CANARD_CRC_TABLE=1)
else()
target_compile_definitions(${COMPONENT_LIB} PRIVATE CANARD_CRC_TABLE=0)
endif()
23 changes: 23 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file defines customizable build options
# if libcanard is used as an ESP-IDF component.
# Configure these values by running 'idf.py menuconfig' in this
# directory.

menu "Libcanard"

config CANARD_ASSERTIONS
bool "Enable libcanard assertions."
default y
help
Set to 'n' to disable libcanard assertions.

config CANARD_CRC_TABLE
bool "Enable libcanard CRC table"
default y
help
Set to 'n' to use slow but ROM-efficient transfer-CRC computation algorithm.
Doing so is expected to save ca. 500 bytes of ROM and
increase the cost of RX/TX transfer processing by ~half.


endmenu
9 changes: 9 additions & 0 deletions idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Metadata for using libcanard as an ESP-IDF component.

# Note: Version is not specified in this file,
# because the 'esp_publish.yml' GitHub action
# automatically sets it based on the release version.

description: "OpenCyphal for embedded systems."
manforowicz marked this conversation as resolved.
Show resolved Hide resolved
url: "https://github.com/OpenCyphal/libcanard"
license: "MIT"
Loading