Using Github workflows for library examples testing

Hello there,

As preparing for a new era of H4 Project, I want to set up a build test workflow against the project examples, I’ve written down my initial thoughts, where I have some questions in mind regarding some issues.

I’ve read the PIO example which illustrates GitHub Actions, which is indeed a good starting point.

Over installing PlatformIO and Python, starts the examples building, by a script which locates each Arduino source file (*.ino), and specifies whether each source file lies a pio config file (platformio.ini) to use it, otherwise use a default one (Lets say on repo root).
Building all examples with all available environments within the config file would make the results and report somehow complex, where some guidance for or recommendations is needed.

On each build (example/environment), the result is either success, therefore the memory usage is logged, both for Flash and RAM, and on failure: the compile log is kept and logged.

The final report which needed to be informed with (via Email perhaps) would have a matrix of each build with Success/Fail, on success the table includes the flash/memory usage, and on fail, a link to the logged compile file.

I’d love to hear from you about recommended tools/methods to achieve this goal:

  • pio run would build for each target in one go, a specific parser is needed for?
  • Where to upload the log file and have the link for? Github has some of a place (instead of gists which is more suitable for codes)?
  • Perhaps a python package is needed to make a table (pandas), any alternative/complementing tool?
  • A different strategy with Git is needed? [As pushing to dev, and on build success (or even on fail): submit a pull request to master.]

What do you think?

Done it with the help of an AI Assistant.

In short: A script that works on push to sources or examples, that iterates over examples, build each in the build directory for each environment in the default config file. A build log per each environment is saved, and on success the RAM and Flash usages are parsed out of the log.

Using Pandas to prepare the whole report which is saved in a custom branch alongwith each build log, and pushed.

Happy it works perfectly on each code push, and it will assist in delivering the project in a better way.

Script link: h4plugins/tools/testbuild.py at master · HamzaHajeir/h4plugins · GitHub