Skip to content

Conversation

cmaglie
Copy link
Contributor

@cmaglie cmaglie commented May 27, 2025

Added sketch compile workflow to build examples for a bunch of boards.
Copied and adapted from https://github.com/arduino-libraries/Arduino_NetworkConfigurator/blob/main/.github/workflows/compile-examples.yml

@cmaglie cmaglie force-pushed the add_sketch_compile branch from a82e543 to 3268332 Compare May 27, 2025 11:39
@cmaglie cmaglie self-assigned this May 27, 2025
@cmaglie cmaglie added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels May 27, 2025
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

You removed the platform dependency information in 3268332 (#7).

That jobs.<job_id>.strategy.matrix.include system is useful to avoid code duplication in the workflow when the same relatively complex configuration is present for multiple compilation targets (I provide a detailed explanation here), but is fairly unintuitive and significantly increases the complexity of the workflow. So it is definitely reasonable to eschew it in this case. However, if you are going to do that then you must define the platform dependency of the target in strategy.matrix.board[*].platform. You can see an example of that approach in the canonical "template" workflow:

https://github.com/per1234/.github/blob/e6a938a7e56096943e02fcb7a7770f1d5c8d6fed/workflow-templates/compile-examples.yml#L44-L45

https://github.com/per1234/.github/blob/e6a938a7e56096943e02fcb7a7770f1d5c8d6fed/workflow-templates/compile-examples.yml#L56

@cmaglie cmaglie force-pushed the add_sketch_compile branch from 3268332 to 98bf0a9 Compare May 28, 2025 08:44
@cmaglie cmaglie marked this pull request as ready for review May 28, 2025 08:59
@cmaglie
Copy link
Contributor Author

cmaglie commented May 28, 2025

Even if the tests are failing, the workflow is ready to go. I'm going to merge it so that the remaining warnings/errors can be fixed in a separate PR.

@cmaglie cmaglie requested review from eigen-value and per1234 May 28, 2025 09:00
Copy link
Collaborator

@eigen-value eigen-value left a comment

Choose a reason for hiding this comment

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

LGTM

@cmaglie
Copy link
Contributor Author

cmaglie commented May 28, 2025

That jobs.<job_id>.strategy.matrix.include system is useful to avoid code duplication in the workflow when the same relatively complex configuration is present for multiple compilation targets (I provide a detailed explanation here), but is fairly unintuitive and significantly increases the complexity of the workflow. So it is definitely reasonable to eschew it in this case. However, if you are going to do that then you must define the platform dependency of the target in strategy.matrix.board[*].platform. You can see an example of that approach in the canonical "template" workflow:

Thanks for the explanation @per1234. In this case, the dependency tree is very simple and straightforward, but good to know for future projects!

@cmaglie cmaglie merged commit ace5a3e into main May 28, 2025
2 of 20 checks passed
@cmaglie cmaglie deleted the add_sketch_compile branch May 28, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants