VikeLabs/vikelabs.ca

Create GitHub Actions for Linting, Formatting, and Building

Closed this issue · 1 comments

User Story

As a developer I would like to add PR action checks so that I can improve our PR process and improve code quality in PRs.

Details

This ticket consists of adding 3 seperate checks, but they all should follow the same process. The github action should spin up and simply run the respective npm script and if it passes, so too does the check. If it fails, the action should fail.

Lint

Should run something like npm run lint which should trigger an eslint command to lint the project, and if there are any errors or warnings (I'm nitpicky) then it should fail.

Formatting

This one I'm less certain about. Generally how I've seen this one implemented in the past is as a simple check with prettier and if there are any issues it fails. Another option (with all of these) is to add a "pre-commit" check in the project. What that means if anyone every tries to commit something, it'll first run a lint + prettier command and if they fail then you're not even allowed to commit. That could be more nitpicky than we want.

Build

This should be fairly simple and consist of a gatsby build command and if it fails, the build fails, if there are no problems building then it passes.

Acceptance Criteria

GitHub actions have been added for

  • Linting
  • Formatting/Prettier
  • Building

RE Formatting:
I think having it as a pre-commit check would indeed be a little over the top. I'll implement it as a PR check that will fail if there are any issues.