Skip to content

Use modern API of arduino/compile-sketches action #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2021
Merged

Use modern API of arduino/compile-sketches action #67

merged 1 commit into from
Oct 18, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Oct 17, 2021

The API of the arduino/compile-sketches GitHub Actions action used to compile the library's example sketches in the "Compile Examples" CI workflow has evolved over time. Although measures were taken to provide backwards compatibility for the old API, it turns out that the GitHub Actions behavior of creating environment variables for arbitrary input names relied upon for still recognizing the old inputs is not consistent across action types. It works fine for the Docker container action type originally used by arduino/compile-sketches, but not for the new "Composite Run Steps" action type we switched to (arduino/compile-sketches#14).

This change resulted in sketch data deltas no longer being generated due to the workflow's use of the unsupported input name enable-size-deltas-report (which was changed to the more appropriate enable-deltas-report last year). This resulted in failed runs of the "Report Size Deltas" due to the reports not having the required deltas data.
Example:
https://github.com/arduino-libraries/Arduino_ConnectionHandler/runs/3918424017?check_suite_focus=true#step:3:17

Traceback (most recent call last):
  File "/reportsizedeltas/reportsizedeltas.py", line 737, in <module>
    main()  # pragma: no cover
  File "/reportsizedeltas/reportsizedeltas.py", line 32, in main
    report_size_deltas.report_size_deltas()
  File "/reportsizedeltas/reportsizedeltas.py", line 95, in report_size_deltas
    self.report_size_deltas_from_workflow_artifacts()
  File "/reportsizedeltas/reportsizedeltas.py", line 149, in report_size_deltas_from_workflow_artifacts
    sketches_reports = self.get_sketches_reports(artifact_folder_object=artifact_folder_object)
  File "/reportsizedeltas/reportsizedeltas.py", line 295, in get_sketches_reports
    not in report_data[self.ReportKeys.boards][0][self.ReportKeys.sizes][0])
KeyError: 'sizes'

The fix is simply to update to the new input name in the "Compile Examples" GitHub Actions workflow that uses the
arduino/compile-sketches action.

I also updated the contents of the action's libraries input to the new YAML array style. This was not mandatory because there is still backwards compatibility for the old API in this case due to the input name not having changed, but only the data format. However, the old data format is deprecated so it's safest to update.

I also removed the no longer used size-report-sketch input. This input was removed at the time the action was changed to report on all compilations

The API of the `arduino/compile-sketches` GitHub Actions action used to compile the library's example sketches in the
"Compile Examples" CI workflow has evolved over time. Although measures were taken to provide backwards compatibility for
the old API, it turns out that the GitHub Actions behavior of creating environment variables for arbitrary input names
relied upon for still recognizing the old inputs is not consistent across action types. It works fine for the Docker
container action type originally used by `arduino/compile-sketches`, but not for the new "Composite Run Steps" action
type we switched to.

This change resulted in sketch data deltas no longer being generated due to the workflow's use of the unsupported input
name `enable-size-deltas-report` (which was changed to the more appropriate `enable-deltas-report` last year). This
resulted in failed runs of the "Report Size Deltas" due to the reports not having the required deltas data.

The fix is simply to update to the new input name in the "Compile Examples" GitHub Actions workflow that uses the
`arduino/compile-sketches` action.

I also updated the contents of the action's `libraries` input to the new YAML array style. This was not mandatory because
there is still backwards compatibility for the old API in this case due to the input name not having changed, but only
the data format. However, the old data format is deprecated so it's safest to update.

I also removed the no longer used `size-report-sketch` input. This input was removed at the time the action was changed
to report on all compilations
@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Oct 17, 2021
@per1234 per1234 requested a review from aentinger October 17, 2021 11:16
@github-actions
Copy link

Memory usage change @ cdd2dd6

Board flash % RAM for global variables %
arduino:mbed:envie_m4 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ConnectionHandlerDemo
flash
% examples/ConnectionHandlerDemo
RAM for global variables
%
arduino:mbed:envie_m4 0 0.0 0 0.0
arduino:mbed:envie_m7 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 0 0.0 0 0.0
arduino:samd:mkr1000 0 0.0 0 0.0
arduino:samd:mkrgsm1400 0 0.0 0 0.0
arduino:samd:mkrnb1500 0 0.0 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0
arduino:samd:mkrwifi1010 0 0.0 0 0.0
arduino:samd:nano_33_iot 0 0.0 0 0.0
esp32:esp32:esp32 0 0.0 0 0.0
esp8266:esp8266:huzzah 0 0.0 0 0.0
Click for full report CSV
Board,examples/ConnectionHandlerDemo<br>flash,%,examples/ConnectionHandlerDemo<br>RAM for global variables,%
arduino:mbed:envie_m4,0,0.0,0,0.0
arduino:mbed:envie_m7,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0
arduino:samd:mkr1000,0,0.0,0,0.0
arduino:samd:mkrgsm1400,0,0.0,0,0.0
arduino:samd:mkrnb1500,0,0.0,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0
arduino:samd:mkrwifi1010,0,0.0,0,0.0
arduino:samd:nano_33_iot,0,0.0,0,0.0
esp32:esp32:esp32,0,0.0,0,0.0
esp8266:esp8266:huzzah,0,0.0,0,0.0

Copy link
Contributor

@aentinger aentinger left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thank you @per1234 for keeping our CI up to date 😘

@aentinger aentinger merged commit 0eadc4a into arduino-libraries:master Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants