-
-
Notifications
You must be signed in to change notification settings - Fork 16
Convert to composite run steps action #14
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
Conversation
When the action was created, the only option for non-JavaScript actions was to use a Docker container. However, GitHub recently added a new action type: the "composite run steps action": https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/creating-a-composite-run-steps-action The Docker container approach has the significant advantage of providing a controlled environment for the action to run in, which will not pollute the general environment of the runner for later workflow steps. However it also has a couple disadvantages: - Docker container actions can only execute on runners with a Linux operating system. - The workspace is mounted to a folder in the container named `/github/workspace`. The problem with the first is it prevents testing for other operating systems. Arduino boards platforms have different toolchains and even build properties according to operating system of the machine they are running on. Only testing on a Linux system may result in missing issues that affect the majority of users. Although more still needs to be done to make the action cross-platform, converting to a composite run steps action is the first step toward that goal. The problem with the second is that, in order to be valid, an Arduino sketch folder must match the filename of the primary sketch file. For a sketch in the root of the repository, a sketch author might achieve this to some limited extent by naming the repository to match the primary sketch file name. However, the container volume is not named according to the repository name, so sketches in the root of the repository are not currently supported by the action (except in the unlikely event the sketch happens to be named "workspace"). Even though structuring sketch repositories in this manner is not best practices due to GitHub's popular "Download ZIP" appending the Git ref to the end of the folder name, the purpose of this action is to compile sketches, not legislate repository policy, so it is reasonable to support this use case. The workspace folder in the GitHub Actions runner is named according to the repository name, meaning that converting to a composite run steps action permits use with sketches in the root of the repository.
Although currently very simple, the action setup script is essential to the proper funtioning of the action, so worthy of some CI.
The test workflow will be most effective if it emulates the environment the action will run in.
Codecov Report
@@ Coverage Diff @@
## main #14 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 1561 1561
=========================================
Hits 1561 1561 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great work!
When the action was created, the only option for non-JavaScript actions was to use a Docker container. However, GitHub
recently added a new action type: the "composite run steps action".
The Docker container approach has the significant advantage of providing a controlled environment for the action to run in, which will not pollute the general environment of the runner for later workflow steps. However it also has a couple disadvantages:
/github/workspace
.The problem with the first is it prevents testing for other operating systems. Arduino boards platforms have different toolchains and even build properties according to operating system of the machine they are running on. Only testing on a Linux system may result in missing issues that affect the majority of users.
Although more still needs to be done to make the action cross-platform (example1, example2), converting to a composite run steps action is the first step toward that goal.
The problem with the second is that, in order to be valid, an Arduino sketch folder must match the filename of the primary sketch file. For a sketch in the root of the repository, a sketch author might achieve this to some limited extent by naming the repository to match the primary sketch file name. However, the container volume is not named according to the repository name, so sketches in the root of the repository are not currently supported by the action (except in the unlikely event the sketch happens to be named "workspace"). Even though structuring sketch repositories in this manner is not best practices due to GitHub's popular "Download ZIP" appending the Git ref to the end of the folder name, the purpose of this action is to compile sketches, not legislate repository policy, so it is reasonable to support this use case.
The workspace folder in the GitHub Actions runner is named according to the repository name, meaning that converting to a composite run steps action permits use with sketches in the root of the repository.
I ran a few workflows with the version of the action from this PR: