arduino / actions

Collection of custom Github actions
Other
34 stars 6 forks source link

Add pySerial to the compile-examples container #85

Closed platisd closed 3 years ago

platisd commented 3 years ago

pySerial is needed to compile sketches for ESP32-based boards. Without including it as a compile-examples container dependency, it is not possible to compile Arduino sketches for a wide range of modern boards.

platisd commented 3 years ago

I trust the error in the action that's failing is not related to my patch. :)

Version 3.8.5 with arch x64 not found Available versions:

2.7.18 (x64) 3.5.10 (x64) 3.6.12 (x64) 3.7.9 (x64) 3.8.6 (x64) 3.9.0 (x64)

per1234 commented 3 years ago

Hi @platisd. Thanks so much for taking the time to submit a PR and for bringing this issue to our attention!

This action is in a bit of an odd transitional phase in that it has been migrated to a dedicated repository: https://github.com/arduino/compile-sketches and maintenance of the outdated version that remains in this repo has been halted (hence the failing test CI workflow), but we haven't made the release in the new repository that is the prequisite to the formal deprecation of the action in this repository.

The action has recently been transitioned from a Docker container to a composite run steps action. This means that the Python script runs directly in the GitHub Actions runner. That change opens up the possibility for the user to install arbitrary boards platform dependencies such as the pyserial package in their workflow in a step prior to running the action.

However, doing this with a Python package specifically was still not possible because the action runs in a venv virtual environment. The solution I found was to configure venv to use the system site packages.

I have submitted a pull request for this change: https://github.com/arduino/compile-sketches/pull/15 If you get the time, please review that PR and approve it if you agree with the change I proposed.

platisd commented 3 years ago

Sounds like an even better solution. Tried it out and it works. Closing this pull request and reviewing the other one you opened.