Skip to content

Use actions/setup-python action to install Python for action #105

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
Mar 17, 2023
Merged

Use actions/setup-python action to install Python for action #105

merged 1 commit into from
Mar 17, 2023

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Mar 17, 2023

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 all actions/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 the actions/setup-python action since patch level bumps are going to be received from Dependabot regardless.

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 all `actions/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 the `actions/setup-python` action since patch level bumps are going to be received from Dependabot
regardless.
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Mar 17, 2023
@per1234 per1234 self-assigned this Mar 17, 2023
@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (de5fc19) 99.81% compared to head (a86705b) 99.81%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #105   +/-   ##
=======================================
  Coverage   99.81%   99.81%           
=======================================
  Files           2        2           
  Lines        1609     1609           
=======================================
  Hits         1606     1606           
  Misses          3        3           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@per1234 per1234 merged commit e5c4238 into arduino:main Mar 17, 2023
@per1234 per1234 deleted the uses-setup branch March 17, 2023 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants