You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pin to last compatible action version in sketch compile workflow (#20)
This library requires a modified "arduino_threads" variant of Arduino CLI. Since the time that variant was made, there
was a breaking change to the key names of Arduino CLI's JSON format output. The `arduino/compile-sketches` action uses
some of the affected keys and so had to be updated to use the new keys. A translation system was put in place to provide
backwards compatibility. However, this translation system requires that the Arduino CLI version specified via the
action's `cli-version` input be semver-compliant so that it can determine whether it came before or after the breaking
change.
The "arduino_threads" variant of Arduino CLI has the fatal combination of the old keys and non-semver version, meaning it is not compatible with versions of the `arduino/compile-sketches` action that came after the fix for the key name changes:
```
Installing platform from path: extras/ArduinoCore-mbed
Traceback (most recent call last):
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 1717, in <module>
main() # pragma: no cover
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 56, in main
compile_sketches.compile_sketches()
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 198, in compile_sketches
self.install_platforms()
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 311, in install_platforms
self.install_platforms_from_path(platform_list=platform_list.path)
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 493, in install_platforms_from_path
platform_installation_path = self.get_platform_installation_path(platform=platform)
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 532, in get_platform_installation_path
if installed_platform[self.cli_json_key("core list", "ID")] == platform[self.dependency_name_key]:
KeyError: 'id'
```
The workaround is to pin version of the `arduino/compile-sketches` action used in the "Compile Examples" workflow to the
last compatible ref. Fortunately, that is quite recent in the action's revision history and none of the changes that came
since should be relevant for this application.
0 commit comments