Skip to content
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

[GitHub Actions] Set up GitHub Actions to automatically build, test, and format #23

Merged
merged 23 commits into from
Oct 26, 2022

Conversation

WeirdAlex03
Copy link
Collaborator

@WeirdAlex03 WeirdAlex03 commented Oct 12, 2022

Proposed changes


Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

This adds a GitHub Actions configuration to automatically verify the project builds, run tests, and run the formatter on pull requests, and share results. An example of the feedback can be found on PR #1 on my fork. You can open new PRs on my fork to test other cases.

A handful of files were not formatted going into this, so the formatting changes on those are also included in this PR.

Closes #22

Types of changes


What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist


Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. This is simply a reminder of what we are going to look for before merging your code.

  • My changeset covers only what is described above (no extraneous changes)
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged downstream

Further comments


If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

This only implements checks that are already part of the project. More actions can be added to the workflow for Code Scanning to automatically detect and report potential security vulnerabilities, or anything else we might want (more about code scanning). I can add them in this PR, if that is wanted.

I also suggest considering a branch protection rule to require some or all tasks to pass before merging is allowed (permissions can be set to allow some/all administrators to bypass this, if wanted).

Lastly, also notable is the low test coverage across many files, as noted in the comment seen on my PR (which can be disabled, btw). I believe we should make it a point to review and improve all of the test suites to ensure there is adequate coverage, both simply in terms of lines of code, and in terms of logical edge/corner cases.

Pretty much just default Node.js config, just changed to only run on PRs
(instead of pushes and PRs targetting "master")
@WeirdAlex03 WeirdAlex03 marked this pull request as draft October 12, 2022 22:47
@WeirdAlex03
Copy link
Collaborator Author

Disregard for now, I meant to open this against my own branch. Since the PR is already here, I'll leave it as a draft, but it's not ready for review yet.

WeirdAlex03 and others added 22 commits October 12, 2022 18:57
package.json defines requirement node >= 16
No idea if this will Just Work (TM), but I guess we'll find out soon!
GH concats it all into one line so escaping the line breaks isnt needed
This uses incorporates mattallty/jest-github-action to add annotations
in the test files on the failing tests, making it easier to
identify the problems
Test and Format now rely on Build, reducing duplicate code
(if this works the way I think it will)
Last commit:
> Test and Format now rely on Build, reducing duplicate code
> (if this works the way I think it will)

It did not. They're still unique environments,
so it still has to be set up for each action
Intentionally failing a test and messing up file formatting
to see how the actions deal with that
I won't tell it to actually commit yet, first I'll review the output
to make sure it isn't committing too much
This reverts the failing test intentionally added in
ddc6ce6
I won't tell it to actually commit yet, first I'll review the output
to make sure it isn't committing too much
@WeirdAlex03 WeirdAlex03 changed the title ci(GH Actions): Initial basic build & test [GitHub Actions] Set up GitHub Actions to automatically build, test, and format Oct 19, 2022
@WeirdAlex03 WeirdAlex03 marked this pull request as ready for review October 19, 2022 23:12
@WeirdAlex03
Copy link
Collaborator Author

This is now done, and I have updated the PR for review. Full details in the main comment at the top. As mentioned there, an example of the feedback can be found on PR #1 on my fork.

@WeirdAlex03 WeirdAlex03 added the enhancement New feature or request label Oct 19, 2022
@jessehartloff jessehartloff merged commit 641e9da into makeopensource:master Oct 26, 2022
@WeirdAlex03 WeirdAlex03 deleted the issue22 branch October 26, 2022 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

[GitHub Actions] Set up GitHub Actions to automatically run tests, etc. on PRs
2 participants