Use actions/setup-python
action to install Python for action
#105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At the time the
arduino/compile-sketches
action was converted to a composite action, the only step type supported for this action type was "run
", where shell commands are executed. For this reason, it was necessary to use shell commands to install Python.Since that time, support was added for using other actions in composite action steps. This allows Python to be set up for use by the action in a more simple and efficient manner via the
actions/setup-python
action.The Python-based infrastructure workflows are also migrated to using
actions/setup-python
action for installing Python. In order to ensure the same version of Python is used for CI as the action, the version of Python used by the project is defined in a.python-version
file, and allactions/setup-python
steps pointed to that file.In order to ensure the stability of the action, the
actions/setup-python
action is pinned to a patch version. Although the common practice is to only pin the major version of actions in CI workflows, in this case there is no benefit to doing so for theactions/setup-python
action since patch level bumps are going to be received from Dependabot regardless.