Skip to content

Commit 15bdb40

Browse files
authored
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.
1 parent 01aca72 commit 15bdb40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/compile-examples.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ jobs:
7272
mv "${{ env.ARDUINOCORE_API_STAGING_PATH }}/api" "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino"
7373
7474
- name: Compile examples
75-
uses: arduino/compile-sketches@main
75+
# Due to using obsolete JSON output keys and a non-semver version, the modified "arduino_threads" version of
76+
# Arduino CLI is not compatible with any version of `arduino/compile-sketches` after this ref, thus the pin:
77+
uses: arduino/compile-sketches@15d79dc244a7a19b8129a83d4d34c6ba44859f01
7678
with:
7779
cli-version: 'arduino_threads'
7880
fqbn: ${{ matrix.fqbn }}

0 commit comments

Comments
 (0)