Skip to content

Bring test workflow into compliance with best practices #42

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 11 commits into from
May 10, 2021
Merged

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented May 7, 2021

  • Meaningful and accurate name
  • Readme badge
  • Cross-platform
  • Don't use unstable development versions of utility actions
  • Use modern actions/setup-node API
  • Use relevant Node.js version
  • Use path filters to avoid unnecessary runs
  • Add convenience triggers

@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels May 7, 2021
@per1234 per1234 requested review from silvanocerza, umbynos and rsora May 7, 2021 21:52
per1234 added 11 commits May 10, 2021 02:41
"setup-taskflile" was an artifact of the project's previous home in the `arduino/actions` repo, which hosts multiple
actions. In that case, it made some sense to have a single monolithic workflow for each project, named after the project.
Now that the action has a dedicated repository. It is more useful to name the workflows according to their intended
purpose.
Previously, tests were only run on Ubuntu and Windows.
Use of the major version ref will cause the workflow to use stable release versions of the utility actions while
automatically benefiting from ongoing development to those actions up until such time as a new major release of an action
is made. At that time we would need to evaluate whether any changes to the workflow are required by the breaking change
that triggered the major release before updating the major ref
(e.g., `uses: actions/checkout@v2` -> `uses: actions/checkout@v3`).
The `version` input name previously in use has been deprecated in favor of `node-version` and is no longer supported:

https://github.com/actions/setup-node/blob/v2.1.5/action.yml#L27
Node.js 12 is the newest version available for the JavaScript GitHub Actions actions, and is the one in use, as specified
in action.yml's `runs.using` key. So it is best to use the same when running the tests in the CI workflow.
The "Test TypeScript" workflow should only run when relevant files are modified.
The `workflow_dispatch` event trigger allows the workflow to be run manually via the GitHub web interface. This can be
useful to trigger the workflow run in cases where the standard triggers won't, such as testing how external changes
(e.g., actions used in the workflow) affected it.

The `repository_dispatch` event serves a similar purpose, except triggered via the GitHub API.
The default behavior is to cancel all the other matrix jobs if one fails. However, it can often be valuable to see what
the results are of the other jobs. In this case where the matrix is operating systems, it can be useful to see whether
the problem is specific to one OS, or if it affects all.
@per1234 per1234 merged commit b8bbd9d into main May 10, 2021
@per1234 per1234 deleted the test-workflow branch May 10, 2021 09:45
@per1234 per1234 self-assigned this Nov 20, 2021
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