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

Conversation

manforowicz
Copy link
Contributor

@manforowicz manforowicz commented Sep 16, 2024

This pull request is meant to resolve #227 by adding continuous integration for publishing Libcanard to the ESP Component Registry.

Files added:

  • idf_component.yml. This file contains required ESP component metadata.
  • Kconfig. ESP components use this file as a standard way for controlling build options. I've added options for enabling/disabling assertions and the CRC table.
  • CMakeLists.txt. This file is required to register the component with the ESP build system.
  • .github/workflows/esp_publish.yml. This workflow uploads the component to the ESP-IDF registry whenever a new GitHub release is published.
  • .github/workflows/esp_dry_run.yml. This workflow does a dry-run of uploading to the ESP-IDF registry, without publishing anything. It can only be manually triggered. I've tested this in my repository, and it seems to work.

The GitHub workflows require IDF_COMPONENT_API_TOKEN with an ESP registry token to be added to the repository secrets.

Copy link
Member

@pavel-kirienko pavel-kirienko left a comment

Choose a reason for hiding this comment

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

Thank you. I have created the token and added it to the repository secrets.

CMakeLists.txt Outdated
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

idf_component.yml Outdated Show resolved Hide resolved
@manforowicz
Copy link
Contributor Author

As you suggested, to avoid polluting the root of the repository with ESP-related files, I tried using repository_info and putting the ESP-related files into a subdirectory. However, this didn't work because ESP-IDF gets confused whenever the source code files are not in the directory where CMakeLists.txt is.

So I decided it would be cleanest to just have the continuous integration script copy all the required files into a temporary component directory before publishing. I tested the esp_dry_run.yml workflow locally, and it seems to work correctly.

pavel-kirienko
pavel-kirienko previously approved these changes Sep 17, 2024
Copy link
Member

@pavel-kirienko pavel-kirienko left a comment

Choose a reason for hiding this comment

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

Looks good. Please address the last two nits and we'll merge it.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the script go into /esp_metadata?

increase the cost of RX/TX transfer processing by ~half.


endmenu
Copy link
Member

Choose a reason for hiding this comment

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

Missing newline at the end

@pavel-kirienko pavel-kirienko merged commit 551af7f into OpenCyphal:master Sep 18, 2024
6 checks passed
@manforowicz manforowicz deleted the add-esp-component-registry branch September 18, 2024 16:47
@manforowicz
Copy link
Contributor Author

Thank you Pavel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add to ESP Component Registry
2 participants